|
46 | 46 | from utilities.constants import Protocols, DscComponents |
47 | 47 | from model_registry import ModelRegistry as ModelRegistryClient |
48 | 48 | from semver import Version |
49 | | -from utilities.infra import get_product_version |
50 | | -from utilities.operator_utils import get_cluster_service_version, validate_operator_subscription_channel |
51 | 49 | from utilities.general import wait_for_pods_by_labels |
52 | 50 |
|
53 | 51 | LOGGER = get_logger(name=__name__) |
@@ -374,47 +372,6 @@ def model_registry_instance_pod(admin_client: DynamicClient) -> Generator[Pod, A |
374 | 372 | )[0] |
375 | 373 |
|
376 | 374 |
|
377 | | -@pytest.fixture(scope="package", autouse=True) |
378 | | -def validate_authorino_operator_version_channel(admin_client: DynamicClient) -> None: |
379 | | - """Check if Authorino operator is installed with required version and channel. |
380 | | -
|
381 | | - This fixture is automatically used for all tests in the model_registry directory. |
382 | | - It verifies that: |
383 | | - 1. For OpenShift AI: The product version is >= 2.20 |
384 | | - 2. The Authorino operator is installed |
385 | | - 3. The Authorino operator is using the required channel (stable) |
386 | | - 4. The Authorino operator is at least version 1.2.1 |
387 | | - """ |
388 | | - distribution = py_config["distribution"] |
389 | | - if distribution == "upstream": |
390 | | - # TODO: figure out minimum version for ODH |
391 | | - LOGGER.info(f"Skipping Authorino operator check for {distribution} distribution") |
392 | | - return |
393 | | - # Only check product version for OpenShift AI |
394 | | - if distribution == "downstream": |
395 | | - product_version = get_product_version(admin_client=admin_client) |
396 | | - if product_version < MIN_MR_VERSION: |
397 | | - LOGGER.info( |
398 | | - "Skipping Authorino operator check - product version " |
399 | | - f"{product_version} is below required {MIN_MR_VERSION}" |
400 | | - ) |
401 | | - return |
402 | | - operator_name = "authorino-operator" |
403 | | - # Find the CSV for the operator |
404 | | - authorino_csv = get_cluster_service_version( |
405 | | - client=admin_client, prefix=operator_name, namespace=py_config["applications_namespace"] |
406 | | - ) |
407 | | - current_authorino_version = authorino_csv.instance.spec.version |
408 | | - if Version.parse(version="1.2.1") > Version.parse(version=current_authorino_version): |
409 | | - pytest.exit( |
410 | | - f"Authorino operator is not at least version 1.2.1. Current version: {current_authorino_version}" |
411 | | - ) |
412 | | - |
413 | | - validate_operator_subscription_channel( |
414 | | - client=admin_client, namespace="openshift-operators", operator_name=operator_name, channel_name="stable" |
415 | | - ) |
416 | | - |
417 | | - |
418 | 375 | @pytest.fixture(scope="class") |
419 | 376 | def is_model_registry_oauth(request: FixtureRequest) -> bool: |
420 | 377 | return getattr(request, "param", {}).get("use_oauth_proxy", False) |
|
0 commit comments