Skip to content

Commit e77c27d

Browse files
committed
utils: add client to create_dv and assert_pvc_snapshot_clone_annotation
Signed-off-by: rkishner <rkishner@redhat.com>
1 parent b1117fc commit e77c27d

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

tests/storage/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ def assert_pvc_snapshot_clone_annotation(pvc, storage_class):
330330
clone_type_annotation_str = f"{Resource.ApiGroup.CDI_KUBEVIRT_IO}/cloneType"
331331
clone_type_annotation = pvc.instance["metadata"].get("annotations").get(clone_type_annotation_str)
332332
# For snapshot capable storage, 'csi-clone' may be set in the StorageProfile
333-
expected_clone_type_annotation = StorageProfile(name=storage_class).instance.status.cloneStrategy
333+
expected_clone_type_annotation = StorageProfile(name=storage_class, client=pvc.client).instance.status.cloneStrategy
334334
assert clone_type_annotation == expected_clone_type_annotation, (
335335
f"{clone_type_annotation_str}: {clone_type_annotation}, expected: '{expected_clone_type_annotation}'"
336336
)
@@ -448,7 +448,7 @@ def assert_num_files_in_pod(pod, expected_num_of_files):
448448

449449
def assert_use_populator(pvc, storage_class, cluster_csi_drivers_names):
450450
expected_use_populator_value = (
451-
StorageClass(name=storage_class).instance.get("provisioner") in cluster_csi_drivers_names
451+
StorageClass(name=storage_class, client=pvc.client).instance.get("provisioner") in cluster_csi_drivers_names
452452
)
453453
assert pvc.use_populator == expected_use_populator_value
454454

utilities/storage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@ def create_dv(
142142
# Make sure URL exists
143143
validate_file_exists_in_url(url=url)
144144
if not secret:
145-
secret = utilities.artifactory.get_artifactory_secret(namespace=namespace)
145+
secret = utilities.artifactory.get_artifactory_secret(namespace=namespace, client=client)
146146
artifactory_secret = secret
147147
if not cert_configmap:
148-
cert_created = utilities.artifactory.get_artifactory_config_map(namespace=namespace)
148+
cert_created = utilities.artifactory.get_artifactory_config_map(namespace=namespace, client=client)
149149
cert_configmap = cert_created.name
150150

151151
with DataVolume(

0 commit comments

Comments
 (0)