Skip to content

Commit d2cf5be

Browse files
committed
Merge remote-tracking branch 'origin/master' into custom-roles
2 parents 0cbe7df + 105450c commit d2cf5be

25 files changed

+1061
-996
lines changed

LICENSE-THIRD-PARTY

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ github.com/cenkalti/backoff/v4,v4.3.0,https://github.com/cenkalti/backoff/blob/v
55
github.com/cespare/xxhash/v2,v2.3.0,https://github.com/cespare/xxhash/blob/v2.3.0/LICENSE.txt,MIT
66
github.com/davecgh/go-spew/spew,v1.1.1,https://github.com/davecgh/go-spew/blob/v1.1.1/LICENSE,ISC
77
github.com/emicklei/go-restful/v3,v3.11.0,https://github.com/emicklei/go-restful/blob/v3.11.0/LICENSE,MIT
8-
github.com/evanphx/json-patch/v5,v5.9.0,https://github.com/evanphx/json-patch/blob/v5.9.0/v5/LICENSE,BSD-3-Clause
8+
github.com/evanphx/json-patch/v5,v5.9.0,https://github.com/evanphx/json-patch/blob/v5.9.0/LICENSE,BSD-3-Clause
99
github.com/fsnotify/fsnotify,v1.7.0,https://github.com/fsnotify/fsnotify/blob/v1.7.0/LICENSE,BSD-3-Clause
1010
github.com/ghodss/yaml,v1.0.0,https://github.com/ghodss/yaml/blob/v1.0.0/LICENSE,MIT
1111
github.com/go-jose/go-jose/v4,v4.0.5,https://github.com/go-jose/go-jose/blob/v4.0.5/LICENSE,Apache-2.0

RELEASE_NOTES.md

Lines changed: 22 additions & 905 deletions
Large diffs are not rendered by default.

RELEASE_NOTES_MEKO.md

Lines changed: 922 additions & 0 deletions
Large diffs are not rendered by default.

api/v1/om/opsmanager_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ type Logging struct {
186186
// ClusterSpecOMItem defines members cluster details for Ops Manager multi-cluster deployment.
187187
type ClusterSpecOMItem struct {
188188
// ClusterName is name of the cluster where the Ops Manager Statefulset will be scheduled.
189-
// The operator is using ClusterName to find API credentials in `mongodb-enterprise-operator-member-list` config map to use for this member cluster.
189+
// The operator is using ClusterName to find API credentials in `mongodb-kubernetes-operator-member-list` config map to use for this member cluster.
190190
// If the credentials are not found, then the member cluster is considered unreachable and ignored in the reconcile process.
191191
// +kubebuilder:validation:Required
192192
ClusterName string `json:"clusterName,omitempty"`

config/crd/bases/mongodb.com_opsmanagers.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,7 @@ spec:
14381438
clusterName:
14391439
description: |-
14401440
ClusterName is name of the cluster where the Ops Manager Statefulset will be scheduled.
1441-
The operator is using ClusterName to find API credentials in `mongodb-enterprise-operator-member-list` config map to use for this member cluster.
1441+
The operator is using ClusterName to find API credentials in `mongodb-kubernetes-operator-member-list` config map to use for this member cluster.
14421442
If the credentials are not found, then the member cluster is considered unreachable and ignored in the reconcile process.
14431443
type: string
14441444
configuration:

docker/mongodb-kubernetes-tests/tests/conftest.py

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
DATABASE_SA_NAME = "mongodb-kubernetes-database-pods"
7171
OM_SA_NAME = "mongodb-kubernetes-ops-manager"
7272
TELEMETRY_CONFIGMAP_NAME = LEGACY_OPERATOR_NAME + "-telemetry"
73+
MULTI_CLUSTER_MEMBER_LIST_CONFIGMAP = OPERATOR_NAME + "-member-list"
7374

7475
logger = test_logger.get_test_logger(__name__)
7576

@@ -855,7 +856,28 @@ def official_operator(
855856
central_cluster_client,
856857
member_cluster_clients,
857858
member_cluster_names,
858-
None,
859+
)
860+
861+
862+
@fixture(scope="module")
863+
def official_meko_operator(
864+
namespace: str,
865+
managed_security_context: str,
866+
operator_installation_config: Dict[str, str],
867+
central_cluster_name: str,
868+
central_cluster_client: client.ApiClient,
869+
member_cluster_clients: List[MultiClusterClient],
870+
member_cluster_names: List[str],
871+
) -> Operator:
872+
return install_official_operator(
873+
namespace,
874+
managed_security_context,
875+
operator_installation_config,
876+
central_cluster_name,
877+
central_cluster_client,
878+
member_cluster_clients,
879+
member_cluster_names,
880+
operator_name=LEGACY_OPERATOR_NAME,
859881
)
860882

861883

@@ -868,6 +890,7 @@ def install_official_operator(
868890
member_cluster_clients: Optional[List[MultiClusterClient]],
869891
member_cluster_names: Optional[List[str]],
870892
custom_operator_version: Optional[str] = None,
893+
operator_name: Optional[str] = OPERATOR_NAME,
871894
) -> Operator:
872895
"""
873896
Installs the Operator from the official Helm Chart.
@@ -886,8 +909,6 @@ def install_official_operator(
886909
"operator.mdbDefaultArchitecture": operator_installation_config["operator.mdbDefaultArchitecture"],
887910
}
888911

889-
operator_name = "mongodb-enterprise-operator"
890-
891912
# Note, that we don't intend to install the official Operator to standalone clusters (kops/openshift) as we want to
892913
# avoid damaged CRDs. But we may need to install the "openshift like" environment to Kind instead of the "ubi"
893914
# images are used for installing the dev Operator
@@ -924,6 +945,7 @@ def install_official_operator(
924945
namespace,
925946
member_cluster_names,
926947
service_account_name=operator_name + "-multi-cluster",
948+
operator_name=operator_name,
927949
)
928950
operator_name = operator_name + "-multi-cluster"
929951
helm_args.update(
@@ -1202,6 +1224,7 @@ def run_kube_config_creation_tool(
12021224
member_cluster_names: List[str],
12031225
cluster_scoped: Optional[bool] = False,
12041226
service_account_name: Optional[str] = "mongodb-kubernetes-operator-multi-cluster",
1227+
operator_name: Optional[str] = OPERATOR_NAME,
12051228
):
12061229
central_cluster = _read_multi_cluster_config_value("central_cluster")
12071230
member_clusters_str = ",".join(member_clusters)
@@ -1222,6 +1245,8 @@ def run_kube_config_creation_tool(
12221245
central_namespace,
12231246
"--service-account",
12241247
service_account_name,
1248+
"--operator-name",
1249+
operator_name,
12251250
]
12261251

12271252
if os.getenv("MULTI_CLUSTER_CREATE_SERVICE_ACCOUNT_TOKEN_SECRETS") == "true":
@@ -1278,6 +1303,7 @@ def run_multi_cluster_recovery_tool(
12781303
member_namespace: str,
12791304
cluster_scoped: Optional[bool] = False,
12801305
service_account_name: Optional[str] = "mongodb-kubernetes-operator-multi-cluster",
1306+
operator_name: Optional[str] = OPERATOR_NAME,
12811307
) -> int:
12821308
central_cluster = _read_multi_cluster_config_value("central_cluster")
12831309
member_clusters_str = ",".join(member_clusters)
@@ -1302,6 +1328,8 @@ def run_multi_cluster_recovery_tool(
13021328
member_clusters[0],
13031329
"--service-account",
13041330
service_account_name,
1331+
"--operator-name",
1332+
operator_name,
13051333
]
13061334
if os.getenv("MULTI_CLUSTER_CREATE_SERVICE_ACCOUNT_TOKEN_SECRETS") == "true":
13071335
args.append("--create-service-account-secrets")

docker/mongodb-kubernetes-tests/tests/multicluster/multi_cluster_recover_clusterwide.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from pytest import fixture, mark
2323
from tests.conftest import (
2424
MULTI_CLUSTER_OPERATOR_NAME,
25+
OPERATOR_NAME,
2526
_install_multi_cluster_operator,
2627
run_kube_config_creation_tool,
2728
run_multi_cluster_recovery_tool,
@@ -97,6 +98,7 @@ def install_operator(
9798
member_cluster_names,
9899
True,
99100
service_account_name=MULTI_CLUSTER_OPERATOR_NAME,
101+
operator_name=OPERATOR_NAME,
100102
)
101103

102104
return _install_multi_cluster_operator(
@@ -218,7 +220,6 @@ def test_prepare_namespace(
218220
def test_copy_configmap_and_secret_across_ns(
219221
namespace: str,
220222
central_cluster_client: client.ApiClient,
221-
multi_cluster_operator_installation_config: Dict[str, str],
222223
mdba_ns: str,
223224
mdbb_ns: str,
224225
):

docker/mongodb-kubernetes-tests/tests/multicluster_appdb/multicluster_appdb_disaster_recovery.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
from kubetester.mongodb import Phase
1515
from kubetester.opsmanager import MongoDBOpsManager
1616
from pytest import fixture, mark
17-
from tests.conftest import create_appdb_certs, get_member_cluster_api_client
17+
from tests.conftest import (
18+
MULTI_CLUSTER_MEMBER_LIST_CONFIGMAP,
19+
create_appdb_certs,
20+
get_member_cluster_api_client,
21+
)
1822
from tests.multicluster.conftest import cluster_spec_list
1923

2024
FAILED_MEMBER_CLUSTER_NAME = "kind-e2e-cluster-3"
@@ -121,7 +125,7 @@ def test_remove_cluster_from_operator_member_list_to_simulate_it_is_unhealthy(
121125
):
122126
member_list_cm = read_configmap(
123127
namespace,
124-
"mongodb-enterprise-operator-member-list",
128+
MULTI_CLUSTER_MEMBER_LIST_CONFIGMAP,
125129
api_client=central_cluster_client,
126130
)
127131
# this if is only for allowing re-running the test locally
@@ -132,7 +136,7 @@ def test_remove_cluster_from_operator_member_list_to_simulate_it_is_unhealthy(
132136
# this will trigger operators restart as it panics on changing the configmap
133137
update_configmap(
134138
namespace,
135-
"mongodb-enterprise-operator-member-list",
139+
MULTI_CLUSTER_MEMBER_LIST_CONFIGMAP,
136140
member_list_cm,
137141
api_client=central_cluster_client,
138142
)

docker/mongodb-kubernetes-tests/tests/multicluster_appdb/multicluster_appdb_state_operator_upgrade_downgrade.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
from typing import Dict, List, Optional
33

44
import kubernetes.client
5-
from kubernetes import client
6-
from kubetester import create_or_update_configmap, get_deployments, read_configmap
5+
from kubetester import read_configmap
76
from kubetester.kubetester import fixture as yaml_fixture
87
from kubetester.mongodb import Phase
98
from kubetester.operator import Operator
@@ -15,12 +14,10 @@
1514
LEGACY_MULTI_CLUSTER_OPERATOR_NAME,
1615
LEGACY_OPERATOR_NAME,
1716
MULTI_CLUSTER_OPERATOR_NAME,
18-
OPERATOR_NAME,
1917
create_appdb_certs,
2018
get_central_cluster_name,
2119
get_custom_appdb_version,
2220
install_official_operator,
23-
local_operator,
2421
log_deployments_info,
2522
)
2623
from tests.multicluster.conftest import cluster_spec_list
@@ -200,7 +197,8 @@ def test_install_legacy_state_official_operator(
200197
central_cluster_client,
201198
member_cluster_clients,
202199
member_cluster_names,
203-
LEGACY_DEPLOYMENT_STATE_VERSION,
200+
custom_operator_version=LEGACY_DEPLOYMENT_STATE_VERSION,
201+
operator_name=LEGACY_OPERATOR_NAME,
204202
)
205203
operator.assert_is_running()
206204
# Dumping deployments in logs ensure we are using the correct operator version
@@ -317,7 +315,8 @@ def test_install_legacy_state_official_operator(
317315
central_cluster_client,
318316
member_cluster_clients,
319317
member_cluster_names,
320-
LEGACY_DEPLOYMENT_STATE_VERSION,
318+
custom_operator_version=LEGACY_DEPLOYMENT_STATE_VERSION,
319+
operator_name=LEGACY_OPERATOR_NAME,
321320
)
322321
operator.assert_is_running()
323322
# Dumping deployments in logs ensure we are using the correct operator version

docker/mongodb-kubernetes-tests/tests/multicluster_shardedcluster/multi_cluster_sharded_disaster_recovery.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
from kubetester.opsmanager import MongoDBOpsManager
2626
from pytest import fixture, mark
2727
from tests import test_logger
28-
from tests.conftest import get_central_cluster_client, get_member_cluster_api_client
28+
from tests.conftest import (
29+
MULTI_CLUSTER_MEMBER_LIST_CONFIGMAP,
30+
get_central_cluster_client,
31+
get_member_cluster_api_client,
32+
)
2933
from tests.multicluster.conftest import cluster_spec_list
3034
from tests.shardedcluster.conftest import (
3135
enable_multi_cluster_deployment,
@@ -157,7 +161,7 @@ def test_create_sharded_cluster(self, sc: MongoDB, config_version_store):
157161
def test_remove_cluster_from_operator_member_list_to_simulate_it_is_unhealthy(
158162
self, namespace, central_cluster_client: kubernetes.client.ApiClient, multi_cluster_operator: Operator
159163
):
160-
operator_cm_name = "mongodb-enterprise-operator-member-list"
164+
operator_cm_name = MULTI_CLUSTER_MEMBER_LIST_CONFIGMAP
161165
logger.debug(f"Deleting cluster {FAILED_MEMBER_CLUSTER_NAME} from configmap {operator_cm_name}")
162166
member_list_cm = read_configmap(
163167
namespace,

0 commit comments

Comments
 (0)