diff --git a/docker/mongodb-kubernetes-tests/kubetester/mongodb.py b/docker/mongodb-kubernetes-tests/kubetester/mongodb.py index c9970361a..f33c6bc9d 100644 --- a/docker/mongodb-kubernetes-tests/kubetester/mongodb.py +++ b/docker/mongodb-kubernetes-tests/kubetester/mongodb.py @@ -216,26 +216,6 @@ def trigger_architecture_migration(self): self["metadata"]["annotations"].update({"mongodb.com/v1.architecture": "static"}) self.update() - def trigger_sts_restart(self, component=""): - """ - Adds or changes a label from the pod template to trigger a rolling restart of that StatefulSet. - Leave component to empty if a ReplicaSet deployment is used. - Set component to either "shard", "config", "mongos" to trigger a restart of the respective StatefulSet. - """ - pod_spec = "podSpec" - if component == "shard": - pod_spec = "shardPodSpec" - elif component == "config": - pod_spec = "configSrvPodSpec" - elif component == "mongos": - pod_spec = "mongosPodSpec" - - self.load() - self["spec"][pod_spec] = { - "podTemplate": {"metadata": {"annotations": {"kubectl.kubernetes.io/restartedAt": str(time.time())}}} - } - self.update() - def assert_connectivity_from_connection_string(self, cnx_string: str, tls: bool, ca_path: Optional[str] = None): """ Tries to connect to a database using a connection string only. diff --git a/docker/mongodb-kubernetes-tests/tests/tls/tls_x509_configure_all_options_rs.py b/docker/mongodb-kubernetes-tests/tests/tls/tls_x509_configure_all_options_rs.py index 12d6cc888..3ce0e099d 100644 --- a/docker/mongodb-kubernetes-tests/tests/tls/tls_x509_configure_all_options_rs.py +++ b/docker/mongodb-kubernetes-tests/tests/tls/tls_x509_configure_all_options_rs.py @@ -48,10 +48,8 @@ def test_ops_manager_state_correctly_updated(self): ac_tester.assert_internal_cluster_authentication_enabled() ac_tester.assert_authentication_enabled() - def test_rotate_certificate_with_sts_restarting(self, mdb: MongoDB, namespace: str): - mdb.trigger_sts_restart() + def test_rotate_certificate(self, mdb: MongoDB, namespace: str): rotate_and_assert_certificates(mdb, namespace, "{}-cert".format(MDB_RESOURCE)) - def test_rotate_clusterfile_with_sts_restarting(self, mdb: MongoDB, namespace: str): - mdb.trigger_sts_restart() + def test_rotate_clusterfile(self, mdb: MongoDB, namespace: str): rotate_and_assert_certificates(mdb, namespace, "{}-clusterfile".format(MDB_RESOURCE)) diff --git a/docker/mongodb-kubernetes-tests/tests/tls/tls_x509_configure_all_options_sc.py b/docker/mongodb-kubernetes-tests/tests/tls/tls_x509_configure_all_options_sc.py index a8424e67c..0360cf580 100644 --- a/docker/mongodb-kubernetes-tests/tests/tls/tls_x509_configure_all_options_sc.py +++ b/docker/mongodb-kubernetes-tests/tests/tls/tls_x509_configure_all_options_sc.py @@ -90,14 +90,11 @@ def test_ops_manager_state_correctly_updated(self): ac_tester.assert_authentication_enabled() ac_tester.assert_expected_users(0) - def test_rotate_shard_cert_with_sts_restarting(self, sc: MongoDB, namespace: str): - sc.trigger_sts_restart("shard") + def test_rotate_shard_cert(self, sc: MongoDB, namespace: str): rotate_and_assert_certificates(sc, namespace, f"{MDB_RESOURCE_NAME}-0-cert") - def test_rotate_config_cert_with_sts_restarting(self, sc: MongoDB, namespace: str): - sc.trigger_sts_restart("config") + def test_rotate_config_cert(self, sc: MongoDB, namespace: str): rotate_and_assert_certificates(sc, namespace, f"{MDB_RESOURCE_NAME}-config-cert") - def test_rotate_mongos_cert_with_sts_restarting(self, sc: MongoDB, namespace: str): - sc.trigger_sts_restart("mongos") + def test_rotate_mongos_cert(self, sc: MongoDB, namespace: str): rotate_and_assert_certificates(sc, namespace, f"{MDB_RESOURCE_NAME}-mongos-cert") diff --git a/docker/mongodb-kubernetes-tests/tests/vaultintegration/mongodb_deployment_vault.py b/docker/mongodb-kubernetes-tests/tests/vaultintegration/mongodb_deployment_vault.py index b6ad82285..69281b479 100644 --- a/docker/mongodb-kubernetes-tests/tests/vaultintegration/mongodb_deployment_vault.py +++ b/docker/mongodb-kubernetes-tests/tests/vaultintegration/mongodb_deployment_vault.py @@ -390,7 +390,6 @@ def wait_for_server_certs() -> bool: def test_rotate_server_certs_with_sts_restarting( replica_set: MongoDB, vault_namespace: str, vault_name: str, namespace: str, issuer: str ): - replica_set.trigger_sts_restart() create_x509_mongodb_tls_certs( issuer, namespace,