@@ -588,47 +588,40 @@ def verify_role():
588588 raise
589589
590590 @timeout_decorator .timeout (TEST_TIMEOUT_SEC )
591- def test_zz_cross_namespace_secrets (self ):
591+ def test_cross_namespace_secrets (self ):
592592 '''
593593 Test secrets in different namespace
594594 '''
595- app_namespace = "appspace"
596-
597- v1_appnamespace = client .V1Namespace (metadata = client .V1ObjectMeta (name = app_namespace ))
598- self .k8s .api .core_v1 .create_namespace (v1_appnamespace )
599- self .k8s .wait_for_namespace_creation (app_namespace )
595+ k8s = self .k8s
600596
597+ # enable secret creation in separate namespace
601598 patch_cross_namespace_secret = {
602599 "data" : {
603600 "enable_cross_namespace_secret" : "true"
604601 }
605602 }
606603 self .k8s .update_config (patch_cross_namespace_secret ,
607604 step = "cross namespace secrets enabled" )
605+ self .eventuallyEqual (lambda : k8s .get_operator_state (), {"0" : "idle" },
606+ "Operator does not get in sync" )
608607
608+ # create secret in test namespace
609609 self .k8s .api .custom_objects_api .patch_namespaced_custom_object (
610610 'acid.zalan.do' , 'v1' , 'default' ,
611611 'postgresqls' , 'acid-minimal-cluster' ,
612612 {
613613 'spec' : {
614614 'users' :{
615- 'appspace .db_user' : [],
615+ 'test .db_user' : [],
616616 }
617617 }
618618 })
619-
620- self .eventuallyEqual (lambda : self .k8s .count_secrets_with_label ("cluster-name=acid-minimal-cluster,application=spilo" , app_namespace ),
619+
620+ self .eventuallyEqual (lambda : k8s .get_operator_state (), {"0" : "idle" },
621+ "Operator does not get in sync" )
622+ self .eventuallyEqual (lambda : self .k8s .count_secrets_with_label ("cluster-name=acid-minimal-cluster,application=spilo" , self .test_namespace ),
621623 1 , "Secret not created for user in namespace" )
622624
623- #reset the flag
624- unpatch_cross_namespace_secret = {
625- "data" : {
626- "enable_cross_namespace_secret" : "false" ,
627- }
628- }
629- self .k8s .update_config (unpatch_cross_namespace_secret , step = "disable cross namespace secrets" )
630-
631-
632625 @timeout_decorator .timeout (TEST_TIMEOUT_SEC )
633626 def test_lazy_spilo_upgrade (self ):
634627 '''
0 commit comments