Skip to content

Commit 3d2e9eb

Browse files
committed
remove version check for validate_authorino_operator_version_channel
1 parent dcb3e2b commit 3d2e9eb

File tree

2 files changed

+0
-66
lines changed

2 files changed

+0
-66
lines changed

tests/model_registry/conftest.py

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@
4646
from utilities.constants import Protocols, DscComponents
4747
from model_registry import ModelRegistry as ModelRegistryClient
4848
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
5149
from utilities.general import wait_for_pods_by_labels
5250

5351
LOGGER = get_logger(name=__name__)
@@ -354,47 +352,6 @@ def model_registry_instance_pod(admin_client: DynamicClient) -> Generator[Pod, A
354352
)[0]
355353

356354

357-
@pytest.fixture(scope="package", autouse=True)
358-
def validate_authorino_operator_version_channel(admin_client: DynamicClient) -> None:
359-
"""Check if Authorino operator is installed with required version and channel.
360-
361-
This fixture is automatically used for all tests in the model_registry directory.
362-
It verifies that:
363-
1. For OpenShift AI: The product version is >= 2.20
364-
2. The Authorino operator is installed
365-
3. The Authorino operator is using the required channel (stable)
366-
4. The Authorino operator is at least version 1.2.1
367-
"""
368-
distribution = py_config["distribution"]
369-
if distribution == "upstream":
370-
# TODO: figure out minimum version for ODH
371-
LOGGER.info(f"Skipping Authorino operator check for {distribution} distribution")
372-
return
373-
# Only check product version for OpenShift AI
374-
if distribution == "downstream":
375-
product_version = get_product_version(admin_client=admin_client)
376-
if product_version < MIN_MR_VERSION:
377-
LOGGER.info(
378-
"Skipping Authorino operator check - product version "
379-
f"{product_version} is below required {MIN_MR_VERSION}"
380-
)
381-
return
382-
operator_name = "authorino-operator"
383-
# Find the CSV for the operator
384-
authorino_csv = get_cluster_service_version(
385-
client=admin_client, prefix=operator_name, namespace=py_config["applications_namespace"]
386-
)
387-
current_authorino_version = authorino_csv.instance.spec.version
388-
if Version.parse(version="1.2.1") > Version.parse(version=current_authorino_version):
389-
pytest.exit(
390-
f"Authorino operator is not at least version 1.2.1. Current version: {current_authorino_version}"
391-
)
392-
393-
validate_operator_subscription_channel(
394-
client=admin_client, namespace="openshift-operators", operator_name=operator_name, channel_name="stable"
395-
)
396-
397-
398355
@pytest.fixture(scope="class")
399356
def is_model_registry_oauth(request: FixtureRequest) -> bool:
400357
return getattr(request, "param", {}).get("use_oauth_proxy", False)

utilities/operator_utils.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
from simple_logger.logger import get_logger
44

55
from ocp_resources.cluster_service_version import ClusterServiceVersion
6-
from ocp_resources.subscription import Subscription
7-
from utilities.exceptions import ResourceMismatchError
86
from utilities.infra import get_product_version
97
from pytest_testconfig import config as py_config
108

@@ -31,27 +29,6 @@ def get_cluster_service_version(client: DynamicClient, prefix: str, namespace: s
3129
return matching_csvs[0]
3230

3331

34-
def validate_operator_subscription_channel(
35-
client: DynamicClient, operator_name: str, namespace: str, channel_name: str
36-
) -> None:
37-
operator_subscriptions = [
38-
subscription
39-
for subscription in Subscription.get(dyn_client=client, namespace=namespace)
40-
if subscription.instance.spec.name == operator_name
41-
]
42-
43-
if not operator_subscriptions:
44-
raise ResourceNotFoundError(f"Subscription not found for operator {operator_name}")
45-
if len(operator_subscriptions) > 1:
46-
raise ResourceNotUniqueError(f"Multiple subscriptions found for operator {operator_name}")
47-
subscription_channel = operator_subscriptions[0].instance.spec.channel
48-
if not subscription_channel or subscription_channel != channel_name:
49-
raise ResourceMismatchError(
50-
f"For Operator {operator_name}, Subscription points to {subscription_channel}, expected: {channel_name}"
51-
)
52-
LOGGER.info(f"Operator {operator_name} subscription channel is {subscription_channel}")
53-
54-
5532
def get_csv_related_images(admin_client: DynamicClient, csv_name: str | None = None) -> List[Dict[str, str]]:
5633
"""Get relatedImages from the CSV.
5734

0 commit comments

Comments
 (0)