Skip to content

Commit bc14ff3

Browse files
committed
model registry ossm request must use v1alpha1 api version
1 parent 9fe8c0e commit bc14ff3

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

tests/model_registry/conftest.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
MODEL_REGISTRY_STANDARD_LABELS,
3737
ISTIO_CONFIG_DICT,
3838
)
39+
from tests.model_registry.rest_api.utils import ModelRegistryV1Alpha1
3940
from utilities.constants import Labels
4041
from tests.model_registry.utils import (
4142
get_endpoint_from_mr_service,
@@ -155,15 +156,16 @@ def model_registry_instance(
155156
) -> Generator[ModelRegistry, Any, Any]:
156157
istio_config = None
157158
oauth_config = None
159+
mr_class_name = ModelRegistry
158160
if is_model_registry_oauth:
159161
LOGGER.warning("Requested Ouath Proxy configuration:")
160162
oauth_config = OAUTH_PROXY_CONFIG_DICT
161163
else:
162164
LOGGER.warning("Requested OSSM configuration:")
163165
istio_config = ISTIO_CONFIG_DICT
166+
mr_class_name = ModelRegistryV1Alpha1
164167
"""Creates a model registry instance with oauth proxy configuration."""
165-
oauth_config = OAUTH_PROXY_CONFIG_DICT
166-
with ModelRegistry(
168+
with mr_class_name(
167169
name=MR_INSTANCE_NAME,
168170
namespace=model_registry_namespace,
169171
label=MODEL_REGISTRY_STANDARD_LABELS,
@@ -175,6 +177,8 @@ def model_registry_instance(
175177
wait_for_resource=True,
176178
) as mr:
177179
mr.wait_for_condition(condition="Available", status="True")
180+
mr.wait_for_condition(condition="OAuthProxyAvailable", status="True")
181+
178182
yield mr
179183

180184

tests/model_registry/rest_api/test_model_registry_rest_api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ def test_validate_model_registry_resource(
9696
)
9797

9898
def test_model_registry_validate_api_version(self: Self, model_registry_instance):
99-
api_version = model_registry_instance.instance.apiVersion
99+
api_version = ModelRegistry(
100+
name=model_registry_instance.name, namespace=model_registry_instance.namespace, ensure_exists=True
101+
).instance.apiVersion
100102
LOGGER.info(f"Validating apiversion {api_version} for model registry")
101103
expected_version = f"{ModelRegistry.ApiGroup.MODELREGISTRY_OPENDATAHUB_IO}/{ModelRegistry.ApiVersion.V1BETA1}"
102104
assert api_version == expected_version

0 commit comments

Comments
 (0)