88from ocp_resources .hyperconverged import HyperConverged
99from ocp_resources .installplan import InstallPlan
1010from ocp_resources .persistent_volume import PersistentVolume
11- from ocp_resources .resource import get_client
1211from pytest_testconfig import py_config
1312
1413from tests .install_upgrade_operators .product_install .constants import (
@@ -140,6 +139,7 @@ def hyperconverged_catalog_source(admin_client, is_production_source, cnv_image_
140139 catalog_source = create_catalog_source (
141140 catalog_name = HCO_CATALOG_SOURCE ,
142141 image = cnv_image_url ,
142+ admin_client = admin_client ,
143143 )
144144 wait_for_catalogsource_ready (
145145 admin_client = admin_client ,
@@ -163,17 +163,19 @@ def created_cnv_namespace(admin_client):
163163
164164
165165@pytest .fixture (scope = "module" )
166- def created_cnv_operator_group (created_cnv_namespace ):
166+ def created_cnv_operator_group (admin_client , created_cnv_namespace ):
167167 cnv_namespace_name = created_cnv_namespace .name
168168 return create_operator_group (
169169 namespace_name = cnv_namespace_name ,
170170 operator_group_name = "openshift-cnv-group" ,
171+ admin_client = admin_client ,
171172 target_namespaces = [cnv_namespace_name ],
172173 )
173174
174175
175176@pytest .fixture (scope = "module" )
176177def installed_cnv_subscription (
178+ admin_client ,
177179 is_production_source ,
178180 hyperconverged_catalog_source ,
179181 created_cnv_namespace ,
@@ -184,6 +186,7 @@ def installed_cnv_subscription(
184186 package_name = py_config ["hco_cr_name" ],
185187 namespace_name = created_cnv_namespace .name ,
186188 catalogsource_name = PRODUCTION_CATALOG_SOURCE if is_production_source else hyperconverged_catalog_source .name ,
189+ admin_client = admin_client ,
187190 channel_name = cnv_version_to_install_info ["channel" ],
188191 )
189192
@@ -230,10 +233,11 @@ def installed_openshift_virtualization(
230233
231234
232235@pytest .fixture (scope = "module" )
233- def created_hco_cr (created_cnv_namespace , installed_openshift_virtualization ):
236+ def created_hco_cr (admin_client , created_cnv_namespace , installed_openshift_virtualization ):
234237 return create_operator (
235238 operator_class = HyperConverged ,
236239 operator_name = py_config ["hco_cr_name" ],
240+ admin_client = admin_client ,
237241 namespace_name = created_cnv_namespace .name ,
238242 )
239243
@@ -266,11 +270,11 @@ def cluster_backend_storage(admin_client):
266270
267271
268272@pytest .fixture (scope = "module" )
269- def hpp_volume_size (cluster_backend_storage ):
273+ def hpp_volume_size (admin_client , cluster_backend_storage ):
270274 hpp_volume_size = "70Gi"
271275 if cluster_backend_storage == LOCAL_BLOCK_HPP :
272276 persistent_volumes = PersistentVolume .get (
273- dyn_client = get_client () ,
277+ dyn_client = admin_client ,
274278 label_selector = f"storage.openshift.com/local-volume-owner-name={ cluster_backend_storage } " ,
275279 )
276280 for persistent_volume in persistent_volumes :
@@ -281,19 +285,22 @@ def hpp_volume_size(cluster_backend_storage):
281285
282286
283287@pytest .fixture (scope = "module" )
284- def installed_hpp (cluster_backend_storage , hpp_volume_size ):
288+ def installed_hpp (admin_client , cluster_backend_storage , hpp_volume_size ):
285289 LOGGER .info (f"Creating HPP CR using backend storage: { cluster_backend_storage } and storage size: { hpp_volume_size } " )
286290 hpp_cr = HPPWithStoragePool (
287291 name = HostPathProvisioner .Name .HOSTPATH_PROVISIONER ,
288292 backend_storage_class_name = cluster_backend_storage ,
289293 volume_size = hpp_volume_size ,
294+ client = admin_client ,
290295 )
291296 hpp_cr .deploy (wait = True )
292297 create_hpp_storage_class (
293298 storage_class_name = HppCsiStorageClass .Name .HOSTPATH_CSI_BASIC ,
299+ admin_client = admin_client ,
294300 )
295301 create_hpp_storage_class (
296302 storage_class_name = HppCsiStorageClass .Name .HOSTPATH_CSI_PVC_BLOCK ,
303+ admin_client = admin_client ,
297304 )
298305
299306
0 commit comments