From 9618a26f0488e44e1246d3b80e8d64084fdd8e60 Mon Sep 17 00:00:00 2001 From: rkishner Date: Wed, 3 Jun 2026 14:55:37 +0300 Subject: [PATCH] utils: add client to create_dv and assert_pvc_snapshot_clone_annotation Signed-off-by: rkishner --- tests/storage/utils.py | 4 ++-- utilities/storage.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/storage/utils.py b/tests/storage/utils.py index 0eb3cf4398..b1a9bfd832 100644 --- a/tests/storage/utils.py +++ b/tests/storage/utils.py @@ -330,7 +330,7 @@ def assert_pvc_snapshot_clone_annotation(pvc, storage_class): clone_type_annotation_str = f"{Resource.ApiGroup.CDI_KUBEVIRT_IO}/cloneType" clone_type_annotation = pvc.instance["metadata"].get("annotations").get(clone_type_annotation_str) # For snapshot capable storage, 'csi-clone' may be set in the StorageProfile - expected_clone_type_annotation = StorageProfile(name=storage_class).instance.status.cloneStrategy + expected_clone_type_annotation = StorageProfile(name=storage_class, client=pvc.client).instance.status.cloneStrategy assert clone_type_annotation == expected_clone_type_annotation, ( f"{clone_type_annotation_str}: {clone_type_annotation}, expected: '{expected_clone_type_annotation}'" ) @@ -451,7 +451,7 @@ def assert_num_files_in_pod(pod, expected_num_of_files): def assert_use_populator(pvc, storage_class, cluster_csi_drivers_names): expected_use_populator_value = ( - StorageClass(name=storage_class).instance.get("provisioner") in cluster_csi_drivers_names + StorageClass(name=storage_class, client=pvc.client).instance.get("provisioner") in cluster_csi_drivers_names ) assert pvc.use_populator == expected_use_populator_value diff --git a/utilities/storage.py b/utilities/storage.py index 236d067795..ca25c49362 100644 --- a/utilities/storage.py +++ b/utilities/storage.py @@ -142,10 +142,10 @@ def create_dv( # Make sure URL exists validate_file_exists_in_url(url=url) if not secret: - secret = utilities.artifactory.get_artifactory_secret(namespace=namespace) + secret = utilities.artifactory.get_artifactory_secret(namespace=namespace, client=client) artifactory_secret = secret if not cert_configmap: - cert_created = utilities.artifactory.get_artifactory_config_map(namespace=namespace) + cert_created = utilities.artifactory.get_artifactory_config_map(namespace=namespace, client=client) cert_configmap = cert_created.name with DataVolume(