diff --git a/charts/postgres-operator/values-crd.yaml b/charts/postgres-operator/values-crd.yaml index 4adcb8b06..b5436fafd 100644 --- a/charts/postgres-operator/values-crd.yaml +++ b/charts/postgres-operator/values-crd.yaml @@ -147,7 +147,7 @@ configKubernetes: pod_terminate_grace_period: 5m # template for database user secrets generated by the operator, # here username contains the namespace in the format namespace.username - # if the user is in different namespace than cluster + # if the secret is in different namespace than cluster secret_name_template: "{username}.{cluster}.credentials.{tprkind}.{tprgroup}" # set user and group for the spilo container (required to run Spilo as non-root process) # spilo_runasuser: "101" diff --git a/e2e/tests/k8s_api.py b/e2e/tests/k8s_api.py index 85bcb6245..3333636ff 100644 --- a/e2e/tests/k8s_api.py +++ b/e2e/tests/k8s_api.py @@ -362,6 +362,17 @@ class K8sBase: time.sleep(self.RETRY_TIMEOUT_SEC) + def wait_for_namespace_creation(self, namespace='default'): + ns_found = False + while ns_found != True: + ns = self.api.core_v1.list_namespaces() + for n in ns: + if n == "appspace": + ns_found = True + break + + time.sleep(self.RETRY_TIMEOUT_SEC) + def get_service_type(self, svc_labels, namespace='default'): svc_type = '' svcs = self.api.core_v1.list_namespaced_service(namespace, label_selector=svc_labels, limit=1).items diff --git a/e2e/tests/test_e2e.py b/e2e/tests/test_e2e.py index 342e62838..bf52ba670 100644 --- a/e2e/tests/test_e2e.py +++ b/e2e/tests/test_e2e.py @@ -594,11 +594,8 @@ class EndToEndTestCase(unittest.TestCase): app_namespace = "appspace" k8s = self.k8s v1_appnamespace = client.V1Namespace(metadata=client.V1ObjectMeta(name=app_namespace)) - try: - k8s.api.core_v1.create_namespace(v1_appnamespace) - except timeout_decorator.TimeoutError: - print('Operator log: {}'.format(k8s.get_operator_log())) - raise + k8s.api.core_v1.create_namespace(v1_appnamespace) + k8s.wait_for_namespace_creation(app_namespace) k8s.api.custom_objects_api.patch_namespaced_custom_object( 'acid.zalan.do', 'v1', 'default',