Skip to content

Commit

Permalink
Fix in storagecluster_independent_check for PC solution
Browse files Browse the repository at this point in the history
Signed-off-by: suchita-g <sgatfane@redhat.com>
This resolution for some of the instances in provider-client testrun with
below error: the server doesn't have a resource type "StorageCluster"
Signed-off-by: suchita-g <sgatfane@redhat.com>
  • Loading branch information
suchita-g committed Nov 24, 2023
1 parent aff64a5 commit 5b49733
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions ocs_ci/helpers/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3014,10 +3014,17 @@ def storagecluster_independent_check():
bool: True if storagecluster is running on external mode False otherwise
"""
if config.ENV_DATA["platform"].lower() in constants.HCI_PROVIDER_CLIENT_PLATFORMS:
provider_kubeconfig = os.path.join(
config.clusters[config.get_provider_index()].ENV_DATA["cluster_path"],
config.clusters[config.get_provider_index()].RUN.get("kubeconfig_location"),
)
cluster_kubeconfig = provider_kubeconfig
else:
cluster_kubeconfig = config.ENV_DATA["cluster_namespace"]

storage_cluster = (
OCP(kind="StorageCluster", namespace=config.ENV_DATA["cluster_namespace"])
.get()
.get("items")[0]
OCP(kind="StorageCluster", namespace=cluster_kubeconfig).get().get("items")[0]
)

return bool(
Expand Down

0 comments on commit 5b49733

Please sign in to comment.