Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
273 changes: 234 additions & 39 deletions .evergreen-tasks.yml

Large diffs are not rendered by default.

124 changes: 82 additions & 42 deletions .evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ task_groups:
- e2e_operator_clusterwide
- e2e_operator_multi_namespaces
- e2e_appdb_tls_operator_upgrade_v1_32_to_mck
- e2e_meko_mck_upgrade
- e2e_mongodbmulticluster_meko_mck_upgrade
<<: *teardown_group

# e2e_operator_race_with_telemetry_task_group includes the tests for testing the operator with race detector enabled
Expand Down Expand Up @@ -815,46 +815,77 @@ task_groups:
- e2e_operator_clusterwide
- e2e_operator_multi_namespaces
- e2e_appdb_tls_operator_upgrade_v1_32_to_mck
- e2e_meko_mck_upgrade
- e2e_mongodbmulticluster_meko_mck_upgrade
<<: *teardown_group

- name: e2e_multi_cluster_kind_task_group
max_hosts: -1
<<: *setup_group
<<: *setup_and_teardown_task_cloudqa
tasks:
- e2e_multi_cluster_replica_set
- e2e_multi_cluster_replica_set_migration
- e2e_multi_cluster_replica_set_member_options
- e2e_multi_cluster_recover
- e2e_multi_cluster_recover_clusterwide
- e2e_multi_cluster_specific_namespaces
- e2e_multi_cluster_scram
- e2e_multi_cluster_tls_with_x509
- e2e_multi_cluster_tls_no_mesh
- e2e_multi_cluster_enable_tls
# e2e_multi_cluster_with_ldap
# e2e_multi_cluster_with_ldap_custom_roles
- e2e_multi_cluster_mtls_test
- e2e_multi_cluster_replica_set_deletion
- e2e_multi_cluster_replica_set_scale_up
- e2e_mongodbmulticluster_multi_cluster_replica_set
- e2e_mongodbmulticluster_multi_cluster_replica_set_migration
- e2e_mongodbmulticluster_multi_cluster_replica_set_member_options
- e2e_mongodbmulticluster_multi_cluster_recover
- e2e_mongodbmulticluster_multi_cluster_recover_clusterwide
- e2e_mongodbmulticluster_multi_cluster_specific_namespaces
- e2e_mongodbmulticluster_multi_cluster_scram
- e2e_mongodbmulticluster_multi_cluster_tls_with_x509
- e2e_mongodbmulticluster_multi_cluster_tls_no_mesh
- e2e_mongodbmulticluster_multi_cluster_enable_tls
# e2e_mongodbmulticluster_multi_cluster_with_ldap
# e2e_mongodbmulticluster_multi_cluster_with_ldap_custom_roles
- e2e_mongodbmulticluster_multi_cluster_mtls_test
- e2e_mongodbmulticluster_multi_cluster_replica_set_deletion
- e2e_mongodbmulticluster_multi_cluster_replica_set_scale_up
- e2e_multi_cluster_new_replica_set_scale_up
- e2e_multi_cluster_scale_up_cluster
- e2e_multi_cluster_scale_up_cluster_new_cluster
- e2e_multi_cluster_replica_set_scale_down
- e2e_multi_cluster_scale_down_cluster
- e2e_multi_sts_override
- e2e_multi_cluster_tls_with_scram
- e2e_multi_cluster_upgrade_downgrade
- e2e_multi_cluster_backup_restore
- e2e_multi_cluster_backup_restore_no_mesh
- e2e_multi_cluster_disaster_recovery
- e2e_multi_cluster_multi_disaster_recovery
- e2e_multi_cluster_recover_network_partition
- e2e_multi_cluster_validation
- e2e_multi_cluster_agent_flags
- e2e_multi_cluster_replica_set_ignore_unknown_users
- e2e_multi_cluster_pvc_resize
- e2e_mongodbmulticluster_multi_cluster_scale_up_cluster
- e2e_mongodbmulticluster_multi_cluster_scale_up_cluster_new_cluster
- e2e_mongodbmulticluster_multi_cluster_replica_set_scale_down
- e2e_mongodbmulticluster_multi_cluster_scale_down_cluster
- e2e_mongodbmulticluster_multi_sts_override
- e2e_mongodbmulticluster_multi_cluster_tls_with_scram
- e2e_mongodbmulticluster_multi_cluster_upgrade_downgrade
- e2e_mongodbmulticluster_multi_cluster_backup_restore
- e2e_mongodbmulticluster_multi_cluster_backup_restore_no_mesh
- e2e_mongodbmulticluster_multi_cluster_disaster_recovery
- e2e_mongodbmulticluster_multi_cluster_multi_disaster_recovery
- e2e_mongodbmulticluster_multi_cluster_recover_network_partition
- e2e_mongodbmulticluster_multi_cluster_validation
- e2e_mongodbmulticluster_multi_cluster_agent_flags
- e2e_mongodbmulticluster_multi_cluster_replica_set_ignore_unknown_users
- e2e_mongodbmulticluster_multi_cluster_pvc_resize
- e2e_mongodb_multi_cluster_replica_set
- e2e_mongodb_multi_cluster_replica_set_migration
- e2e_mongodb_multi_cluster_replica_set_member_options
- e2e_mongodb_multi_cluster_recover
- e2e_mongodb_multi_cluster_recover_clusterwide
- e2e_mongodb_multi_cluster_specific_namespaces
- e2e_mongodb_multi_cluster_scram
- e2e_mongodb_multi_cluster_tls_with_x509
- e2e_mongodb_multi_cluster_tls_no_mesh
- e2e_mongodb_multi_cluster_enable_tls
# e2e_mongodb_multi_cluster_with_ldap
# e2e_mongodb_multi_cluster_with_ldap_custom_roles
- e2e_mongodb_multi_cluster_mtls_test
- e2e_mongodb_multi_cluster_replica_set_deletion
- e2e_mongodb_multi_cluster_replica_set_scale_up
- e2e_mongodb_multi_cluster_scale_up_cluster
- e2e_mongodb_multi_cluster_scale_up_cluster_new_cluster
- e2e_mongodb_multi_cluster_replica_set_scale_down
- e2e_mongodb_multi_cluster_scale_down_cluster
- e2e_mongodb_multi_sts_override
- e2e_mongodb_multi_cluster_tls_with_scram
- e2e_mongodb_multi_cluster_upgrade_downgrade
- e2e_mongodb_multi_cluster_backup_restore
- e2e_mongodb_multi_cluster_backup_restore_no_mesh
- e2e_mongodb_multi_cluster_disaster_recovery
- e2e_mongodb_multi_cluster_multi_disaster_recovery
- e2e_mongodb_multi_cluster_recover_network_partition
- e2e_mongodb_multi_cluster_validation
- e2e_mongodb_multi_cluster_agent_flags
- e2e_mongodb_multi_cluster_replica_set_ignore_unknown_users
- e2e_mongodb_multi_cluster_pvc_resize
- e2e_multi_cluster_sharded_geo_sharding
- e2e_multi_cluster_sharded_scaling
- e2e_multi_cluster_sharded_scaling_all_shard_overrides
Expand Down Expand Up @@ -884,12 +915,15 @@ task_groups:
- e2e_tls_sc_additional_certs
- e2e_tls_x509_configure_all_options_sc
- e2e_tls_x509_sc
- e2e_meko_mck_upgrade
- e2e_mongodbmulticluster_meko_mck_upgrade
- e2e_mongodbmulticluster_custom_roles
- e2e_mongodb_custom_roles
- e2e_sharded_cluster_oidc_m2m_group
- e2e_sharded_cluster_oidc_m2m_user
- e2e_multi_cluster_oidc_m2m_group
- e2e_multi_cluster_oidc_m2m_user
- e2e_mongodbmulticluster_multi_cluster_oidc_m2m_group
- e2e_mongodbmulticluster_multi_cluster_oidc_m2m_user
- e2e_mongodb_multi_cluster_oidc_m2m_group
- e2e_mongodb_multi_cluster_oidc_m2m_user

<<: *teardown_group

Expand All @@ -898,8 +932,10 @@ task_groups:
<<: *setup_group
<<: *setup_and_teardown_task_cloudqa
tasks:
- e2e_multi_cluster_2_clusters_replica_set
- e2e_multi_cluster_2_clusters_clusterwide
- e2e_mongodbmulticluster_multi_cluster_2_clusters_replica_set
- e2e_mongodbmulticluster_multi_cluster_2_clusters_clusterwide
- e2e_mongodb_multi_cluster_2_clusters_replica_set
- e2e_mongodb_multi_cluster_2_clusters_clusterwide
<<: *teardown_group

- name: e2e_multi_cluster_om_appdb_task_group
Expand All @@ -912,11 +948,13 @@ task_groups:
- e2e_multi_cluster_om_validation
- e2e_multi_cluster_appdb
- e2e_multi_cluster_appdb_cleanup
- e2e_multi_cluster_appdb_s3_based_backup_restore
- e2e_mongodbmulticluster_multi_cluster_appdb_s3_based_backup_restore
- e2e_mongodb_multi_cluster_appdb_s3_based_backup_restore
- e2e_multi_cluster_appdb_disaster_recovery
- e2e_multi_cluster_appdb_disaster_recovery_force_reconfigure
- e2e_multi_cluster_om_networking_clusterwide
- e2e_multi_cluster_om_appdb_no_mesh
- e2e_mongodbmulticluster_multi_cluster_om_appdb_no_mesh
- e2e_mongodb_multi_cluster_om_appdb_no_mesh
# Reused OM tests with AppDB Multi-Cluster topology
- e2e_appdb_tls_operator_upgrade_v1_32_to_mck
- e2e_om_appdb_flags_and_config
Expand Down Expand Up @@ -967,11 +1005,13 @@ task_groups:
- e2e_multi_cluster_om_validation
- e2e_multi_cluster_appdb
- e2e_multi_cluster_appdb_cleanup
- e2e_multi_cluster_appdb_s3_based_backup_restore
- e2e_mongodbmulticluster_multi_cluster_appdb_s3_based_backup_restore
- e2e_mongodb_multi_cluster_appdb_s3_based_backup_restore
- e2e_multi_cluster_appdb_disaster_recovery
- e2e_multi_cluster_appdb_disaster_recovery_force_reconfigure
- e2e_multi_cluster_om_networking_clusterwide
- e2e_multi_cluster_om_appdb_no_mesh
- e2e_mongodbmulticluster_multi_cluster_om_appdb_no_mesh
- e2e_mongodb_multi_cluster_om_appdb_no_mesh
# Reused OM tests with AppDB Multi-Cluster topology
- e2e_om_appdb_flags_and_config
- e2e_om_appdb_upgrade
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,8 @@ func TestReadState_ClusterMapping_ReadsFromAnnotation(t *testing.T) {
func TestReadState_ClusterMapping_FallbackToStatusMembers(t *testing.T) {
rs := &mdbv1.MongoDB{
ObjectMeta: metav1.ObjectMeta{
Name: "test-rs",
Namespace: mock.TestNamespace,
Name: "test-rs",
Namespace: mock.TestNamespace,
Annotations: map[string]string{
// No ClusterMapping annotation
},
Expand All @@ -453,8 +453,8 @@ func TestReadState_ClusterMapping_FallbackToStatusMembers(t *testing.T) {
func TestReadState_ClusterMapping_SkipsMigrationForMultiCluster(t *testing.T) {
rs := &mdbv1.MongoDB{
ObjectMeta: metav1.ObjectMeta{
Name: "test-rs",
Namespace: mock.TestNamespace,
Name: "test-rs",
Namespace: mock.TestNamespace,
Annotations: map[string]string{
// No state annotations
},
Expand Down Expand Up @@ -488,8 +488,8 @@ func TestReadState_ClusterMapping_SkipsMigrationForMultiCluster(t *testing.T) {
func TestReadState_LastAppliedMemberSpec_FallbackToStatusMembers(t *testing.T) {
rs := &mdbv1.MongoDB{
ObjectMeta: metav1.ObjectMeta{
Name: "test-rs",
Namespace: mock.TestNamespace,
Name: "test-rs",
Namespace: mock.TestNamespace,
Annotations: map[string]string{
// No LastAppliedMemberSpec annotation
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
get_mongodb_x509_subject,
multi_cluster_service_fqdns,
)
from kubetester.mongodb import MongoDB
from kubetester.mongodb_multi import MongoDBMulti
from kubetester.multicluster_client import MultiClusterClient

Expand All @@ -18,7 +19,7 @@ def create_multi_cluster_agent_certs(
multi_cluster_issuer: str,
secret_name: str,
central_cluster_client: kubernetes.client.ApiClient,
mongodb_multi: MongoDBMulti,
mongodb_multi: MongoDBMulti | MongoDB,
secret_backend: Optional[str] = None,
) -> str:
agents = ["mms-automation-agent"]
Expand Down Expand Up @@ -49,7 +50,7 @@ def create_multi_cluster_x509_agent_certs(
multi_cluster_issuer: str,
secret_name: str,
central_cluster_client: kubernetes.client.ApiClient,
mongodb_multi: MongoDBMulti,
mongodb_multi: MongoDBMulti | MongoDB,
secret_backend: Optional[str] = None,
) -> str:
spec = get_agent_x509_subject(mongodb_multi.namespace)
Expand All @@ -73,7 +74,7 @@ def create_multi_cluster_mongodb_tls_certs(
bundle_secret_name: str,
member_cluster_clients: List[MultiClusterClient],
central_cluster_client: kubernetes.client.ApiClient,
mongodb_multi: Optional[MongoDBMulti] = None,
mongodb_multi: Optional[MongoDBMulti | MongoDB] = None,
namespace: Optional[str] = None,
additional_domains: Optional[List[str]] = None,
service_fqdns: Optional[List[str]] = None,
Expand All @@ -100,7 +101,7 @@ def create_multi_cluster_mongodb_x509_tls_certs(
bundle_secret_name: str,
member_cluster_clients: List[MultiClusterClient],
central_cluster_client: kubernetes.client.ApiClient,
mongodb_multi: MongoDBMulti,
mongodb_multi: MongoDBMulti | MongoDB,
additional_domains: Optional[List[str]] = None,
service_fqdns: Optional[List[str]] = None,
clusterwide: bool = False,
Expand Down
10 changes: 10 additions & 0 deletions docker/mongodb-kubernetes-tests/kubetester/mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,16 @@ def read_statefulsets(self, clients: List[MultiClusterClient]) -> Dict[str, clie
def assert_connectivity(self, ca_path: Optional[str] = None, cluster_domain: str = "cluster.local"):
return self.tester(ca_path=ca_path).assert_connectivity()

def get_item_spec(self, cluster_name: str) -> Dict:
for spec in sorted(
self["spec"]["clusterSpecList"],
key=lambda x: x["clusterName"],
):
if spec["clusterName"] == cluster_name:
return spec

raise ValueError(f"Cluster with name {cluster_name} not found!")

def set_architecture_annotation(self):
if "annotations" not in self["metadata"]:
self["metadata"]["annotations"] = {}
Expand Down
Loading