Skip to content

Commit c73066a

Browse files
committed
Merge remote-tracking branch 'origin/master' into lsierant/latest-from-master
2 parents 1be6cf0 + 74638f2 commit c73066a

26 files changed

+360
-254
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ precommit:
6262
switch:
6363
@ scripts/dev/switch_context.sh $(context) $(additional_override)
6464

65+
switcht:
66+
@ scripts/dev/switch_context_by_test.sh $(test)
67+
6568
# builds the Operator binary file and docker image and pushes it to the remote registry if using a remote registry. Deploys it to
6669
# k8s cluster
6770
operator: configure-operator build-and-push-operator-image
@@ -322,9 +325,9 @@ deploy: manifests kustomize
322325
undeploy:
323326
$(KUSTOMIZE) build config/default | kubectl delete -f -
324327

325-
# Generate manifests e.g. CRD, RBAC etc.
328+
# Generate manifests e.g. CRD etc.
326329
manifests: controller-gen
327-
export PATH="$(PATH)"; export GOROOT=$(GOROOT); $(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role paths=./... output:crd:artifacts:config=config/crd/bases
330+
export PATH="$(PATH)"; export GOROOT=$(GOROOT); $(CONTROLLER_GEN) $(CRD_OPTIONS) paths=./... output:crd:artifacts:config=config/crd/bases
328331
# copy the CRDs to the public folder
329332
cp config/crd/bases/* helm_chart/crds/
330333
cat "helm_chart/crds/"* > public/crds.yaml

config/manager/manager.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,14 @@ spec:
196196
value: "quay.io/mongodb/mongodb-agent-ubi:12.0.35.7911-1_1.0.1"
197197
- name: RELATED_IMAGE_AGENT_IMAGE_12_0_35_7911_1_1_1_0
198198
value: "quay.io/mongodb/mongodb-agent-ubi:12.0.35.7911-1_1.1.0"
199-
- name: RELATED_IMAGE_AGENT_IMAGE_13_35_0_9498_1
200-
value: "quay.io/mongodb/mongodb-agent-ubi:13.35.0.9498-1"
201-
- name: RELATED_IMAGE_AGENT_IMAGE_13_35_0_9498_1_1_0_0
202-
value: "quay.io/mongodb/mongodb-agent-ubi:13.35.0.9498-1_1.0.0"
203-
- name: RELATED_IMAGE_AGENT_IMAGE_13_35_0_9498_1_1_0_1
204-
value: "quay.io/mongodb/mongodb-agent-ubi:13.35.0.9498-1_1.0.1"
205-
- name: RELATED_IMAGE_AGENT_IMAGE_13_35_0_9498_1_1_1_0
206-
value: "quay.io/mongodb/mongodb-agent-ubi:13.35.0.9498-1_1.1.0"
199+
- name: RELATED_IMAGE_AGENT_IMAGE_13_36_0_9555_1
200+
value: "quay.io/mongodb/mongodb-agent-ubi:13.36.0.9555-1"
201+
- name: RELATED_IMAGE_AGENT_IMAGE_13_36_0_9555_1_1_0_0
202+
value: "quay.io/mongodb/mongodb-agent-ubi:13.36.0.9555-1_1.0.0"
203+
- name: RELATED_IMAGE_AGENT_IMAGE_13_36_0_9555_1_1_0_1
204+
value: "quay.io/mongodb/mongodb-agent-ubi:13.36.0.9555-1_1.0.1"
205+
- name: RELATED_IMAGE_AGENT_IMAGE_13_36_0_9555_1_1_1_0
206+
value: "quay.io/mongodb/mongodb-agent-ubi:13.36.0.9555-1_1.1.0"
207207
- name: RELATED_IMAGE_OPS_MANAGER_IMAGE_REPOSITORY_6_0_25
208208
value: "quay.io/mongodb/mongodb-enterprise-ops-manager-ubi:6.0.25"
209209
- name: RELATED_IMAGE_OPS_MANAGER_IMAGE_REPOSITORY_6_0_26

config/rbac/role.yaml

Lines changed: 0 additions & 156 deletions
This file was deleted.

config/rbac/role_binding.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

helm_chart/values-openshift.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ relatedImages:
124124
- 12.0.35.7911-1_1.0.0
125125
- 12.0.35.7911-1_1.0.1
126126
- 12.0.35.7911-1_1.1.0
127-
- 13.35.0.9498-1
128-
- 13.35.0.9498-1_1.0.0
129-
- 13.35.0.9498-1_1.0.1
130-
- 13.35.0.9498-1_1.1.0
127+
- 13.36.0.9555-1
128+
- 13.36.0.9555-1_1.0.0
129+
- 13.36.0.9555-1_1.0.1
130+
- 13.36.0.9555-1_1.1.0
131131
mongodbLegacyAppDb:
132132
- 4.2.11-ent
133133
- 4.2.2-ent

pipeline.py

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -735,11 +735,15 @@ def submit(self, fn, *args, **kwargs):
735735
return super().submit(lambda: fn(*args, **kwargs))
736736

737737

738-
def should_skip_arm64():
738+
def should_skip_arm64(config: BuildConfiguration) -> bool:
739739
"""
740-
Determines if arm64 builds should be skipped based on environment.
741-
Returns True if running in Evergreen pipeline as a patch.
740+
Determines if arm64 builds should be skipped based on environment.
741+
Determines if arm64 builds should be skipped based on BuildConfiguration or environment.```
742+
And skipping the evergreen detail.
742743
"""
744+
if config.is_release_step_executed():
745+
return False
746+
743747
return is_running_in_evg_pipeline() and is_running_in_patch()
744748

745749

@@ -765,8 +769,8 @@ def get_architectures_set(build_configuration, args):
765769
if arch_set == {"arm64"}:
766770
raise ValueError("Building for ARM64 only is not supported yet")
767771

768-
if should_skip_arm64():
769-
logger.info("Skipping ARM64 builds as this is running in EVG pipeline as a patch")
772+
if should_skip_arm64(build_configuration):
773+
logger.info("Skipping ARM64 builds as this is running in as a patch and not a release step.")
770774
return {"amd64"}
771775

772776
# Automatic architecture detection is the default behavior if 'arch' argument isn't specified
@@ -824,6 +828,10 @@ def inner(build_configuration: BuildConfiguration):
824828
args["release_version"] = version
825829

826830
arch_set = get_architectures_set(build_configuration, args)
831+
span = trace.get_current_span()
832+
span.set_attribute("mck.architectures", str(arch_set))
833+
span.set_attribute("mck.architectures_numbers", len(arch_set))
834+
span.set_attribute("mck.release", build_configuration.is_release_step_executed())
827835

828836
if version not in completed_versions:
829837
if arch_set == {"amd64", "arm64"}:
@@ -973,6 +981,7 @@ def build_om_image(build_configuration: BuildConfiguration):
973981
)
974982

975983

984+
@TRACER.start_as_current_span("build_image_generic")
976985
def build_image_generic(
977986
config: BuildConfiguration,
978987
image_name: str,
@@ -1028,6 +1037,12 @@ def build_image_generic(
10281037
if config.sign and config.is_release_step_executed():
10291038
sign_and_verify_context_image(registry, version)
10301039

1040+
span = trace.get_current_span()
1041+
span.set_attribute("mck.image.image_name", image_name)
1042+
span.set_attribute("mck.image.version", version)
1043+
span.set_attribute("mck.image.is_release", config.is_release_step_executed())
1044+
span.set_attribute("mck.image.is_multi_arch", is_multi_arch)
1045+
10311046
# Release step. Release images via the daily image process.
10321047
if config.is_release_step_executed() and version and QUAY_REGISTRY_URL in registry:
10331048
logger.info(
@@ -1082,7 +1097,7 @@ def build_community_image(build_configuration: BuildConfiguration, image_type: s
10821097
golang_version = os.getenv("GOLANG_VERSION", "1.24")
10831098

10841099
# Use only amd64 if we should skip arm64 builds
1085-
if should_skip_arm64():
1100+
if should_skip_arm64(build_configuration):
10861101
architectures = ["amd64"]
10871102
logger.info("Skipping ARM64 builds for community image as this is running in EVG pipeline as a patch")
10881103
else:
@@ -1197,7 +1212,7 @@ def build_multi_arch_agent_in_sonar(
11971212
joined_args = [args | arch_amd]
11981213

11991214
# Only include arm64 if we shouldn't skip it
1200-
if not should_skip_arm64():
1215+
if not should_skip_arm64(build_configuration):
12011216
joined_args.append(args | arch_arm)
12021217

12031218
build_image_generic(

public/mongodb-kubernetes-openshift.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -478,14 +478,14 @@ spec:
478478
value: "quay.io/mongodb/mongodb-agent-ubi:12.0.35.7911-1_1.0.1"
479479
- name: RELATED_IMAGE_AGENT_IMAGE_12_0_35_7911_1_1_1_0
480480
value: "quay.io/mongodb/mongodb-agent-ubi:12.0.35.7911-1_1.1.0"
481-
- name: RELATED_IMAGE_AGENT_IMAGE_13_35_0_9498_1
482-
value: "quay.io/mongodb/mongodb-agent-ubi:13.35.0.9498-1"
483-
- name: RELATED_IMAGE_AGENT_IMAGE_13_35_0_9498_1_1_0_0
484-
value: "quay.io/mongodb/mongodb-agent-ubi:13.35.0.9498-1_1.0.0"
485-
- name: RELATED_IMAGE_AGENT_IMAGE_13_35_0_9498_1_1_0_1
486-
value: "quay.io/mongodb/mongodb-agent-ubi:13.35.0.9498-1_1.0.1"
487-
- name: RELATED_IMAGE_AGENT_IMAGE_13_35_0_9498_1_1_1_0
488-
value: "quay.io/mongodb/mongodb-agent-ubi:13.35.0.9498-1_1.1.0"
481+
- name: RELATED_IMAGE_AGENT_IMAGE_13_36_0_9555_1
482+
value: "quay.io/mongodb/mongodb-agent-ubi:13.36.0.9555-1"
483+
- name: RELATED_IMAGE_AGENT_IMAGE_13_36_0_9555_1_1_0_0
484+
value: "quay.io/mongodb/mongodb-agent-ubi:13.36.0.9555-1_1.0.0"
485+
- name: RELATED_IMAGE_AGENT_IMAGE_13_36_0_9555_1_1_0_1
486+
value: "quay.io/mongodb/mongodb-agent-ubi:13.36.0.9555-1_1.0.1"
487+
- name: RELATED_IMAGE_AGENT_IMAGE_13_36_0_9555_1_1_1_0
488+
value: "quay.io/mongodb/mongodb-agent-ubi:13.36.0.9555-1_1.1.0"
489489
- name: RELATED_IMAGE_OPS_MANAGER_IMAGE_REPOSITORY_6_0_25
490490
value: "quay.io/mongodb/mongodb-enterprise-ops-manager-ubi:6.0.25"
491491
- name: RELATED_IMAGE_OPS_MANAGER_IMAGE_REPOSITORY_6_0_26

public/tools/multicluster/cmd/recover.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package cmd
33
import (
44
"fmt"
55
"os"
6+
"slices"
67
"strings"
78

89
"github.com/mongodb/mongodb-kubernetes/multi/pkg/common"
@@ -68,12 +69,12 @@ kubectl-mongodb multicluster recover --central-cluster="operator-cluster" --memb
6869
var RecoverFlags = common.Flags{}
6970

7071
func parseRecoverFlags(args []string) error {
71-
if common.AnyAreEmpty(common.MemberClusters, RecoverFlags.ServiceAccount, RecoverFlags.CentralCluster, RecoverFlags.MemberClusterNamespace, RecoverFlags.CentralClusterNamespace, RecoverFlags.SourceCluster) {
72+
if slices.Contains([]string{common.MemberClusters, RecoverFlags.ServiceAccount, RecoverFlags.CentralCluster, RecoverFlags.MemberClusterNamespace, RecoverFlags.CentralClusterNamespace, RecoverFlags.SourceCluster}, "") {
7273
return xerrors.Errorf("non empty values are required for [service-account, member-clusters, central-cluster, member-cluster-namespace, central-cluster-namespace, source-cluster]")
7374
}
7475

7576
RecoverFlags.MemberClusters = strings.Split(common.MemberClusters, ",")
76-
if !common.Contains(RecoverFlags.MemberClusters, RecoverFlags.SourceCluster) {
77+
if !slices.Contains(RecoverFlags.MemberClusters, RecoverFlags.SourceCluster) {
7778
return xerrors.Errorf("source-cluster has to be one of the healthy member clusters: %s", common.MemberClusters)
7879
}
7980

public/tools/multicluster/cmd/setup.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55
"os"
66
"runtime/debug"
7+
"slices"
78
"strings"
89

910
"github.com/mongodb/mongodb-kubernetes/multi/pkg/common"
@@ -75,7 +76,7 @@ kubectl-mongodb multicluster setup --central-cluster="operator-cluster" --member
7576
var setupFlags = common.Flags{}
7677

7778
func parseSetupFlags() error {
78-
if common.AnyAreEmpty(common.MemberClusters, setupFlags.ServiceAccount, setupFlags.CentralCluster, setupFlags.MemberClusterNamespace, setupFlags.CentralClusterNamespace) {
79+
if slices.Contains([]string{common.MemberClusters, setupFlags.ServiceAccount, setupFlags.CentralCluster, setupFlags.MemberClusterNamespace, setupFlags.CentralClusterNamespace}, "") {
7980
return xerrors.Errorf("non empty values are required for [service-account, member-clusters, central-cluster, member-cluster-namespace, central-cluster-namespace]")
8081
}
8182

public/tools/multicluster/pkg/common/utils.go

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)