@@ -107,7 +107,7 @@ def get_version_id():
107
107
108
108
109
109
@fixture (scope = "module" )
110
- def operator_installation_config (namespace : str ) -> Dict [str , str ]:
110
+ def operator_installation_config (namespace : str ) -> dict [str , str ]:
111
111
return get_operator_installation_config (namespace )
112
112
113
113
@@ -126,7 +126,7 @@ def get_operator_installation_config(namespace):
126
126
127
127
128
128
@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 ]:
130
130
"""Returns the ConfigMap containing configuration data for the Operator to be created
131
131
and for the AppDB to be monitored.
132
132
Created in the single_e2e.sh"""
@@ -135,7 +135,7 @@ def monitored_appdb_operator_installation_config(operator_installation_config: D
135
135
return config
136
136
137
137
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 ]:
139
139
"""Returns the ConfigMap containing configuration data for the Operator to be created.
140
140
Created in the single_e2e.sh"""
141
141
config = KubernetesTester .read_configmap (
@@ -150,7 +150,7 @@ def get_multi_cluster_operator_installation_config(namespace: str) -> Dict[str,
150
150
@fixture (scope = "module" )
151
151
def multi_cluster_operator_installation_config (
152
152
central_cluster_client : kubernetes .client .ApiClient , namespace : str
153
- ) -> Dict [str , str ]:
153
+ ) -> dict [str , str ]:
154
154
return get_multi_cluster_operator_installation_config (namespace )
155
155
156
156
@@ -159,15 +159,15 @@ def multi_cluster_monitored_appdb_operator_installation_config(
159
159
central_cluster_client : kubernetes .client .ApiClient ,
160
160
namespace : str ,
161
161
multi_cluster_operator_installation_config : dict [str , str ],
162
- ) -> Dict [str , str ]:
162
+ ) -> dict [str , str ]:
163
163
multi_cluster_operator_installation_config ["customEnvVars" ] = f"OPS_MANAGER_MONITOR_APPDB=true"
164
164
return multi_cluster_operator_installation_config
165
165
166
166
167
167
@fixture (scope = "module" )
168
168
def operator_clusterwide (
169
169
namespace : str ,
170
- operator_installation_config : Dict [str , str ],
170
+ operator_installation_config : dict [str , str ],
171
171
) -> Operator :
172
172
return get_operator_clusterwide (namespace , operator_installation_config )
173
173
@@ -181,7 +181,7 @@ def get_operator_clusterwide(namespace, operator_installation_config):
181
181
@fixture (scope = "module" )
182
182
def operator_vault_secret_backend (
183
183
namespace : str ,
184
- monitored_appdb_operator_installation_config : Dict [str , str ],
184
+ monitored_appdb_operator_installation_config : dict [str , str ],
185
185
) -> Operator :
186
186
helm_args = monitored_appdb_operator_installation_config .copy ()
187
187
helm_args ["operator.vaultSecretBackend.enabled" ] = "true"
@@ -191,7 +191,7 @@ def operator_vault_secret_backend(
191
191
@fixture (scope = "module" )
192
192
def operator_vault_secret_backend_tls (
193
193
namespace : str ,
194
- monitored_appdb_operator_installation_config : Dict [str , str ],
194
+ monitored_appdb_operator_installation_config : dict [str , str ],
195
195
) -> Operator :
196
196
helm_args = monitored_appdb_operator_installation_config .copy ()
197
197
helm_args ["operator.vaultSecretBackend.enabled" ] = "true"
@@ -200,7 +200,7 @@ def operator_vault_secret_backend_tls(
200
200
201
201
202
202
@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 ]:
204
204
"""
205
205
This functions appends automatic recovery settings for CLOUDP-189433. In order to make the test runnable in
206
206
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():
480
480
@fixture (scope = "module" )
481
481
def default_operator (
482
482
namespace : str ,
483
- operator_installation_config : Dict [str , str ],
483
+ operator_installation_config : dict [str , str ],
484
484
central_cluster_name : str ,
485
- multi_cluster_operator_installation_config : Dict [str , str ],
485
+ multi_cluster_operator_installation_config : dict [str , str ],
486
486
central_cluster_client : client .ApiClient ,
487
487
member_cluster_clients : List [MultiClusterClient ],
488
488
member_cluster_names : List [str ],
@@ -500,24 +500,23 @@ def default_operator(
500
500
501
501
502
502
def 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
505
504
) -> Operator :
506
505
"""Installs/upgrades a default Operator used by any test not interested in some custom Operator setting.
507
506
TODO we use the helm template | kubectl apply -f process so far as Helm install/upgrade needs more refactoring in
508
507
the shared environment"""
509
508
operator = Operator (
510
509
namespace = namespace ,
511
510
helm_args = operator_installation_config ,
512
- ).upgrade ()
511
+ ).upgrade (apply_crds_first = apply_crds_first )
513
512
514
513
return operator
515
514
516
515
517
516
@fixture (scope = "module" )
518
517
def operator_with_monitored_appdb (
519
518
namespace : str ,
520
- monitored_appdb_operator_installation_config : Dict [str , str ],
519
+ monitored_appdb_operator_installation_config : dict [str , str ],
521
520
) -> Operator :
522
521
"""Installs/upgrades a default Operator used by any test that needs the AppDB monitoring enabled."""
523
522
return Operator (
@@ -628,7 +627,7 @@ def member_cluster_clients() -> List[MultiClusterClient]:
628
627
def multi_cluster_operator (
629
628
namespace : str ,
630
629
central_cluster_name : str ,
631
- multi_cluster_operator_installation_config : Dict [str , str ],
630
+ multi_cluster_operator_installation_config : dict [str , str ],
632
631
central_cluster_client : client .ApiClient ,
633
632
member_cluster_clients : List [MultiClusterClient ],
634
633
member_cluster_names : List [str ],
@@ -646,10 +645,11 @@ def multi_cluster_operator(
646
645
def get_multi_cluster_operator (
647
646
namespace : str ,
648
647
central_cluster_name : str ,
649
- multi_cluster_operator_installation_config : Dict [str , str ],
648
+ multi_cluster_operator_installation_config : dict [str , str ],
650
649
central_cluster_client : client .ApiClient ,
651
650
member_cluster_clients : List [MultiClusterClient ],
652
651
member_cluster_names : List [str ],
652
+ apply_crds_first : bool = False ,
653
653
) -> Operator :
654
654
os .environ ["HELM_KUBECONTEXT" ] = central_cluster_name
655
655
@@ -667,14 +667,15 @@ def get_multi_cluster_operator(
667
667
"operator.createOperatorServiceAccount" : "false" ,
668
668
},
669
669
central_cluster_name ,
670
+ apply_crds_first = apply_crds_first ,
670
671
)
671
672
672
673
673
674
@fixture (scope = "module" )
674
675
def multi_cluster_operator_with_monitored_appdb (
675
676
namespace : str ,
676
677
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 ],
678
679
central_cluster_client : client .ApiClient ,
679
680
member_cluster_clients : List [MultiClusterClient ],
680
681
member_cluster_names : List [str ],
@@ -703,7 +704,7 @@ def multi_cluster_operator_with_monitored_appdb(
703
704
def multi_cluster_operator_manual_remediation (
704
705
namespace : str ,
705
706
central_cluster_name : str ,
706
- multi_cluster_operator_installation_config : Dict [str , str ],
707
+ multi_cluster_operator_installation_config : dict [str , str ],
707
708
central_cluster_client : client .ApiClient ,
708
709
member_cluster_clients : List [MultiClusterClient ],
709
710
member_cluster_names : List [str ],
@@ -754,7 +755,7 @@ def get_multi_cluster_operator_clustermode(namespace: str) -> Operator:
754
755
def multi_cluster_operator_clustermode (
755
756
namespace : str ,
756
757
central_cluster_name : str ,
757
- multi_cluster_operator_installation_config : Dict [str , str ],
758
+ multi_cluster_operator_installation_config : dict [str , str ],
758
759
central_cluster_client : client .ApiClient ,
759
760
member_cluster_clients : List [MultiClusterClient ],
760
761
member_cluster_names : List [str ],
@@ -767,7 +768,7 @@ def multi_cluster_operator_clustermode(
767
768
def install_multi_cluster_operator_set_members_fn (
768
769
namespace : str ,
769
770
central_cluster_name : str ,
770
- multi_cluster_operator_installation_config : Dict [str , str ],
771
+ multi_cluster_operator_installation_config : dict [str , str ],
771
772
central_cluster_client : client .ApiClient ,
772
773
member_cluster_clients : List [MultiClusterClient ],
773
774
) -> Callable [[List [str ]], Operator ]:
@@ -793,14 +794,15 @@ def _fn(member_cluster_names: List[str]) -> Operator:
793
794
794
795
def _install_multi_cluster_operator (
795
796
namespace : str ,
796
- multi_cluster_operator_installation_config : Dict [str , str ],
797
+ multi_cluster_operator_installation_config : dict [str , str ],
797
798
central_cluster_client : client .ApiClient ,
798
799
member_cluster_clients : List [MultiClusterClient ],
799
- helm_opts : Dict [str , str ],
800
+ helm_opts : dict [str , str ],
800
801
central_cluster_name : str ,
801
802
operator_name : Optional [str ] = MULTI_CLUSTER_OPERATOR_NAME ,
802
803
helm_chart_path : Optional [str ] = LOCAL_HELM_CHART_DIR ,
803
804
custom_operator_version : Optional [str ] = None ,
805
+ apply_crds_first : bool = False ,
804
806
) -> Operator :
805
807
multi_cluster_operator_installation_config .update (helm_opts )
806
808
@@ -822,7 +824,7 @@ def _install_multi_cluster_operator(
822
824
helm_args = multi_cluster_operator_installation_config ,
823
825
api_client = central_cluster_client ,
824
826
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 )
826
828
827
829
# If we're running locally, then immediately after installing the deployment, we scale it to zero.
828
830
# This way operator in POD is not interfering with locally running one.
@@ -840,7 +842,7 @@ def _install_multi_cluster_operator(
840
842
def official_operator (
841
843
namespace : str ,
842
844
managed_security_context : str ,
843
- operator_installation_config : Dict [str , str ],
845
+ operator_installation_config : dict [str , str ],
844
846
central_cluster_name : str ,
845
847
central_cluster_client : client .ApiClient ,
846
848
member_cluster_clients : List [MultiClusterClient ],
@@ -919,7 +921,7 @@ def install_legacy_deployment_state_meko(
919
921
def install_official_operator (
920
922
namespace : str ,
921
923
managed_security_context : str ,
922
- operator_installation_config : Dict [str , str ],
924
+ operator_installation_config : dict [str , str ],
923
925
central_cluster_name : Optional [str ],
924
926
central_cluster_client : Optional [client .ApiClient ],
925
927
member_cluster_clients : Optional [List [MultiClusterClient ]],
@@ -1033,7 +1035,7 @@ def log_deployment_and_images(deployments):
1033
1035
1034
1036
# Extract container images and deployments names from the nested dict returned by kubetester
1035
1037
# 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 ]):
1037
1039
deployment_images = {}
1038
1040
deployment_names = []
1039
1041
deployments = deployments .to_dict ()
@@ -1318,7 +1320,7 @@ def get_api_servers_from_kubeconfig_secret(
1318
1320
return get_api_servers_from_pod_kubeconfig (kubeconfig_secret ["kubeconfig" ], cluster_clients )
1319
1321
1320
1322
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 ]:
1322
1324
test_pod_cluster = get_test_pod_cluster_name ()
1323
1325
cluster_clients = get_clients_for_clusters (member_cluster_names )
1324
1326
0 commit comments