@@ -107,7 +107,7 @@ def get_version_id():
107107
108108
109109@fixture (scope = "module" )
110- def operator_installation_config (namespace : str ) -> Dict [str , str ]:
110+ def operator_installation_config (namespace : str ) -> dict [str , str ]:
111111 return get_operator_installation_config (namespace )
112112
113113
@@ -126,7 +126,7 @@ def get_operator_installation_config(namespace):
126126
127127
128128@fixture (scope = "module" )
129- def monitored_appdb_operator_installation_config (operator_installation_config : Dict [str , str ]) -> Dict [str , str ]:
129+ def monitored_appdb_operator_installation_config (operator_installation_config : dict [str , str ]) -> dict [str , str ]:
130130 """Returns the ConfigMap containing configuration data for the Operator to be created
131131 and for the AppDB to be monitored.
132132 Created in the single_e2e.sh"""
@@ -135,7 +135,7 @@ def monitored_appdb_operator_installation_config(operator_installation_config: D
135135 return config
136136
137137
138- def get_multi_cluster_operator_installation_config (namespace : str ) -> Dict [str , str ]:
138+ def get_multi_cluster_operator_installation_config (namespace : str ) -> dict [str , str ]:
139139 """Returns the ConfigMap containing configuration data for the Operator to be created.
140140 Created in the single_e2e.sh"""
141141 config = KubernetesTester .read_configmap (
@@ -150,7 +150,7 @@ def get_multi_cluster_operator_installation_config(namespace: str) -> Dict[str,
150150@fixture (scope = "module" )
151151def multi_cluster_operator_installation_config (
152152 central_cluster_client : kubernetes .client .ApiClient , namespace : str
153- ) -> Dict [str , str ]:
153+ ) -> dict [str , str ]:
154154 return get_multi_cluster_operator_installation_config (namespace )
155155
156156
@@ -159,15 +159,15 @@ def multi_cluster_monitored_appdb_operator_installation_config(
159159 central_cluster_client : kubernetes .client .ApiClient ,
160160 namespace : str ,
161161 multi_cluster_operator_installation_config : dict [str , str ],
162- ) -> Dict [str , str ]:
162+ ) -> dict [str , str ]:
163163 multi_cluster_operator_installation_config ["customEnvVars" ] = f"OPS_MANAGER_MONITOR_APPDB=true"
164164 return multi_cluster_operator_installation_config
165165
166166
167167@fixture (scope = "module" )
168168def operator_clusterwide (
169169 namespace : str ,
170- operator_installation_config : Dict [str , str ],
170+ operator_installation_config : dict [str , str ],
171171) -> Operator :
172172 return get_operator_clusterwide (namespace , operator_installation_config )
173173
@@ -181,7 +181,7 @@ def get_operator_clusterwide(namespace, operator_installation_config):
181181@fixture (scope = "module" )
182182def operator_vault_secret_backend (
183183 namespace : str ,
184- monitored_appdb_operator_installation_config : Dict [str , str ],
184+ monitored_appdb_operator_installation_config : dict [str , str ],
185185) -> Operator :
186186 helm_args = monitored_appdb_operator_installation_config .copy ()
187187 helm_args ["operator.vaultSecretBackend.enabled" ] = "true"
@@ -191,7 +191,7 @@ def operator_vault_secret_backend(
191191@fixture (scope = "module" )
192192def operator_vault_secret_backend_tls (
193193 namespace : str ,
194- monitored_appdb_operator_installation_config : Dict [str , str ],
194+ monitored_appdb_operator_installation_config : dict [str , str ],
195195) -> Operator :
196196 helm_args = monitored_appdb_operator_installation_config .copy ()
197197 helm_args ["operator.vaultSecretBackend.enabled" ] = "true"
@@ -200,7 +200,7 @@ def operator_vault_secret_backend_tls(
200200
201201
202202@fixture (scope = "module" )
203- def operator_installation_config_quick_recovery (operator_installation_config : Dict [str , str ]) -> Dict [str , str ]:
203+ def operator_installation_config_quick_recovery (operator_installation_config : dict [str , str ]) -> dict [str , str ]:
204204 """
205205 This functions appends automatic recovery settings for CLOUDP-189433. In order to make the test runnable in
206206 reasonable time, we override the Recovery back off to 120 seconds. This gives enough time for the initial
@@ -480,9 +480,9 @@ def get_custom_om_version():
480480@fixture (scope = "module" )
481481def default_operator (
482482 namespace : str ,
483- operator_installation_config : Dict [str , str ],
483+ operator_installation_config : dict [str , str ],
484484 central_cluster_name : str ,
485- multi_cluster_operator_installation_config : Dict [str , str ],
485+ multi_cluster_operator_installation_config : dict [str , str ],
486486 central_cluster_client : client .ApiClient ,
487487 member_cluster_clients : List [MultiClusterClient ],
488488 member_cluster_names : List [str ],
@@ -500,24 +500,23 @@ def default_operator(
500500
501501
502502def get_default_operator (
503- namespace : str ,
504- operator_installation_config : Dict [str , str ],
503+ namespace : str , operator_installation_config : dict [str , str ], apply_crds_first : bool = False
505504) -> Operator :
506505 """Installs/upgrades a default Operator used by any test not interested in some custom Operator setting.
507506 TODO we use the helm template | kubectl apply -f process so far as Helm install/upgrade needs more refactoring in
508507 the shared environment"""
509508 operator = Operator (
510509 namespace = namespace ,
511510 helm_args = operator_installation_config ,
512- ).upgrade ()
511+ ).upgrade (apply_crds_first = apply_crds_first )
513512
514513 return operator
515514
516515
517516@fixture (scope = "module" )
518517def operator_with_monitored_appdb (
519518 namespace : str ,
520- monitored_appdb_operator_installation_config : Dict [str , str ],
519+ monitored_appdb_operator_installation_config : dict [str , str ],
521520) -> Operator :
522521 """Installs/upgrades a default Operator used by any test that needs the AppDB monitoring enabled."""
523522 return Operator (
@@ -628,7 +627,7 @@ def member_cluster_clients() -> List[MultiClusterClient]:
628627def multi_cluster_operator (
629628 namespace : str ,
630629 central_cluster_name : str ,
631- multi_cluster_operator_installation_config : Dict [str , str ],
630+ multi_cluster_operator_installation_config : dict [str , str ],
632631 central_cluster_client : client .ApiClient ,
633632 member_cluster_clients : List [MultiClusterClient ],
634633 member_cluster_names : List [str ],
@@ -646,10 +645,11 @@ def multi_cluster_operator(
646645def get_multi_cluster_operator (
647646 namespace : str ,
648647 central_cluster_name : str ,
649- multi_cluster_operator_installation_config : Dict [str , str ],
648+ multi_cluster_operator_installation_config : dict [str , str ],
650649 central_cluster_client : client .ApiClient ,
651650 member_cluster_clients : List [MultiClusterClient ],
652651 member_cluster_names : List [str ],
652+ apply_crds_first : bool = False ,
653653) -> Operator :
654654 os .environ ["HELM_KUBECONTEXT" ] = central_cluster_name
655655
@@ -667,14 +667,15 @@ def get_multi_cluster_operator(
667667 "operator.createOperatorServiceAccount" : "false" ,
668668 },
669669 central_cluster_name ,
670+ apply_crds_first = apply_crds_first ,
670671 )
671672
672673
673674@fixture (scope = "module" )
674675def multi_cluster_operator_with_monitored_appdb (
675676 namespace : str ,
676677 central_cluster_name : str ,
677- multi_cluster_monitored_appdb_operator_installation_config : Dict [str , str ],
678+ multi_cluster_monitored_appdb_operator_installation_config : dict [str , str ],
678679 central_cluster_client : client .ApiClient ,
679680 member_cluster_clients : List [MultiClusterClient ],
680681 member_cluster_names : List [str ],
@@ -703,7 +704,7 @@ def multi_cluster_operator_with_monitored_appdb(
703704def multi_cluster_operator_manual_remediation (
704705 namespace : str ,
705706 central_cluster_name : str ,
706- multi_cluster_operator_installation_config : Dict [str , str ],
707+ multi_cluster_operator_installation_config : dict [str , str ],
707708 central_cluster_client : client .ApiClient ,
708709 member_cluster_clients : List [MultiClusterClient ],
709710 member_cluster_names : List [str ],
@@ -754,7 +755,7 @@ def get_multi_cluster_operator_clustermode(namespace: str) -> Operator:
754755def multi_cluster_operator_clustermode (
755756 namespace : str ,
756757 central_cluster_name : str ,
757- multi_cluster_operator_installation_config : Dict [str , str ],
758+ multi_cluster_operator_installation_config : dict [str , str ],
758759 central_cluster_client : client .ApiClient ,
759760 member_cluster_clients : List [MultiClusterClient ],
760761 member_cluster_names : List [str ],
@@ -767,7 +768,7 @@ def multi_cluster_operator_clustermode(
767768def install_multi_cluster_operator_set_members_fn (
768769 namespace : str ,
769770 central_cluster_name : str ,
770- multi_cluster_operator_installation_config : Dict [str , str ],
771+ multi_cluster_operator_installation_config : dict [str , str ],
771772 central_cluster_client : client .ApiClient ,
772773 member_cluster_clients : List [MultiClusterClient ],
773774) -> Callable [[List [str ]], Operator ]:
@@ -793,14 +794,15 @@ def _fn(member_cluster_names: List[str]) -> Operator:
793794
794795def _install_multi_cluster_operator (
795796 namespace : str ,
796- multi_cluster_operator_installation_config : Dict [str , str ],
797+ multi_cluster_operator_installation_config : dict [str , str ],
797798 central_cluster_client : client .ApiClient ,
798799 member_cluster_clients : List [MultiClusterClient ],
799- helm_opts : Dict [str , str ],
800+ helm_opts : dict [str , str ],
800801 central_cluster_name : str ,
801802 operator_name : Optional [str ] = MULTI_CLUSTER_OPERATOR_NAME ,
802803 helm_chart_path : Optional [str ] = LOCAL_HELM_CHART_DIR ,
803804 custom_operator_version : Optional [str ] = None ,
805+ apply_crds_first : bool = False ,
804806) -> Operator :
805807 multi_cluster_operator_installation_config .update (helm_opts )
806808
@@ -822,7 +824,7 @@ def _install_multi_cluster_operator(
822824 helm_args = multi_cluster_operator_installation_config ,
823825 api_client = central_cluster_client ,
824826 helm_chart_path = helm_chart_path ,
825- ).upgrade (multi_cluster = True , custom_operator_version = custom_operator_version )
827+ ).upgrade (multi_cluster = True , custom_operator_version = custom_operator_version , apply_crds_first = apply_crds_first )
826828
827829 # If we're running locally, then immediately after installing the deployment, we scale it to zero.
828830 # This way operator in POD is not interfering with locally running one.
@@ -840,7 +842,7 @@ def _install_multi_cluster_operator(
840842def official_operator (
841843 namespace : str ,
842844 managed_security_context : str ,
843- operator_installation_config : Dict [str , str ],
845+ operator_installation_config : dict [str , str ],
844846 central_cluster_name : str ,
845847 central_cluster_client : client .ApiClient ,
846848 member_cluster_clients : List [MultiClusterClient ],
@@ -919,7 +921,7 @@ def install_legacy_deployment_state_meko(
919921def install_official_operator (
920922 namespace : str ,
921923 managed_security_context : str ,
922- operator_installation_config : Dict [str , str ],
924+ operator_installation_config : dict [str , str ],
923925 central_cluster_name : Optional [str ],
924926 central_cluster_client : Optional [client .ApiClient ],
925927 member_cluster_clients : Optional [List [MultiClusterClient ]],
@@ -1033,7 +1035,7 @@ def log_deployment_and_images(deployments):
10331035
10341036# Extract container images and deployments names from the nested dict returned by kubetester
10351037# Handles any missing key gracefully
1036- def extract_container_images_and_deployments (deployments ) -> (Dict [str , str ], List [str ]):
1038+ def extract_container_images_and_deployments (deployments ) -> (dict [str , str ], List [str ]):
10371039 deployment_images = {}
10381040 deployment_names = []
10391041 deployments = deployments .to_dict ()
@@ -1318,7 +1320,7 @@ def get_api_servers_from_kubeconfig_secret(
13181320 return get_api_servers_from_pod_kubeconfig (kubeconfig_secret ["kubeconfig" ], cluster_clients )
13191321
13201322
1321- def get_api_servers_from_test_pod_kubeconfig (namespace : str , member_cluster_names : List [str ]) -> Dict [str , str ]:
1323+ def get_api_servers_from_test_pod_kubeconfig (namespace : str , member_cluster_names : List [str ]) -> dict [str , str ]:
13221324 test_pod_cluster = get_test_pod_cluster_name ()
13231325 cluster_clients = get_clients_for_clusters (member_cluster_names )
13241326
0 commit comments