|
25 | 25 | create_configmap_from_yaml, |
26 | 26 | create_namespace_with_name_from_yaml, |
27 | 27 | create_ns_and_sa_from_yaml, |
| 28 | + create_opaque_license_secret, |
28 | 29 | create_secret_from_yaml, |
29 | 30 | create_service_from_yaml, |
30 | 31 | delete_namespace, |
@@ -240,11 +241,20 @@ def ingress_controller_prerequisites(cli_arguments, kube_apis, request) -> Ingre |
240 | 241 | ] |
241 | 242 | ) |
242 | 243 | config_map_yaml = f"{DEPLOYMENTS}/common/nginx-config.yaml" |
| 244 | + mgmt_config_map_yaml = f"{DEPLOYMENTS}/common/plus-mgmt-configmap.yaml" |
243 | 245 | create_configmap_from_yaml(kube_apis.v1, namespace, config_map_yaml) |
244 | 246 | with open(config_map_yaml) as f: |
245 | 247 | config_map = yaml.safe_load(f) |
| 248 | + |
246 | 249 | create_secret_from_yaml(kube_apis.v1, namespace, f"{TEST_DATA}/common/default-server-secret.yaml") |
247 | 250 |
|
| 251 | + # setup Plus JWT configuration |
| 252 | + if cli_arguments["ic-type"] == "nginx-plus-ingress" and "plus-jwt" in cli_arguments: |
| 253 | + print("Create Plus JWT Secret:") |
| 254 | + secret_name = create_opaque_license_secret(kube_apis.v1, namespace, cli_arguments["plus-jwt"]) |
| 255 | + print(f"Secret created: {secret_name}") |
| 256 | + create_configmap_from_yaml(kube_apis.v1, namespace, mgmt_config_map_yaml) |
| 257 | + |
248 | 258 | def fin(): |
249 | 259 | if request.config.getoption("--skip-fixture-teardown") == "no": |
250 | 260 | print("Clean up prerequisites") |
@@ -323,6 +333,11 @@ def cli_arguments(request) -> {}: |
323 | 333 | result["ic-type"] = request.config.getoption("--ic-type") |
324 | 334 | assert result["ic-type"] in ALLOWED_IC_TYPES, f"IC type {result['ic-type']} is not allowed" |
325 | 335 | print(f"Tests will run against the IC of type: {result['ic-type']}") |
| 336 | + if result["ic-type"] == "nginx-plus-ingress": |
| 337 | + jwt = request.config.getoption("--plus-jwt", None) |
| 338 | + assert jwt is not None and jwt != "", f"ic-type nginx-plus-ingress needs a jwt" |
| 339 | + result["plus-jwt"] = jwt |
| 340 | + print(f"Tests will use the Plus JWT: {result['plus-jwt']}") |
326 | 341 |
|
327 | 342 | result["replicas"] = request.config.getoption("--replicas") |
328 | 343 | print(f"Number of pods spun up will be : {result['replicas']}") |
|
0 commit comments