From 79260418ebe6a927105d8215b9690bf90b906ec9 Mon Sep 17 00:00:00 2001 From: parth-gr Date: Wed, 8 Jan 2025 19:24:09 +0530 Subject: [PATCH] external: fix rados namespace sc name Currently, the sc name is hardcoded, in future if we support multiple rados namespace per tenant we need a variable name updating sc names to contain rados-namespace name ocs pr: https://github.com/red-hat-storage/ocs-operator/pull/2955 Signed-off-by: parth-gr (cherry picked from commit 61de34a11de24a3a6464569b38cc8645fc4e1bd2) --- deploy/examples/create-external-cluster-resources.py | 2 +- deploy/examples/import-external-cluster.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/deploy/examples/create-external-cluster-resources.py b/deploy/examples/create-external-cluster-resources.py index e704619c3e41a..d27853607e051 100644 --- a/deploy/examples/create-external-cluster-resources.py +++ b/deploy/examples/create-external-cluster-resources.py @@ -1896,7 +1896,7 @@ def gen_json_out(self): ) json_out.append( { - "name": "ceph-rbd-rados-namespace", + "name": f"ceph-rbd-rados-namespace-{self.out_map['RADOS_NAMESPACE']}", "kind": "StorageClass", "data": { "pool": self.out_map["RBD_POOL_NAME"], diff --git a/deploy/examples/import-external-cluster.sh b/deploy/examples/import-external-cluster.sh index f13c109310112..5435ccaa62d33 100644 --- a/deploy/examples/import-external-cluster.sh +++ b/deploy/examples/import-external-cluster.sh @@ -127,11 +127,13 @@ function importClusterID() { createRadosNamespaceCR timeout 20 sh -c "until [ $($KUBECTL -n "$NAMESPACE" get CephBlockPoolRadosNamespace/"$RADOS_NAMESPACE" -o jsonpath='{.status.phase}' | grep -c "Ready") -eq 1 ]; do echo "waiting for radosNamespace to get created" && sleep 1; done" CLUSTER_ID_RBD=$($KUBECTL -n "$NAMESPACE" get cephblockpoolradosnamespace.ceph.rook.io/"$RADOS_NAMESPACE" -o jsonpath='{.status.info.clusterID}') + RBD_STORAGE_CLASS_NAME=ceph-rbd-$RADOS_NAMESPACE fi if [ -n "$SUBVOLUME_GROUP" ]; then createSubvolumeGroupCR timeout 20 sh -c "until [ $($KUBECTL -n "$NAMESPACE" get CephFilesystemSubVolumeGroup/"$SUBVOLUME_GROUP" -o jsonpath='{.status.phase}' | grep -c "Ready") -eq 1 ]; do echo "waiting for radosNamespace to get created" && sleep 1; done" CLUSTER_ID_CEPHFS=$($KUBECTL -n "$NAMESPACE" get cephfilesystemsubvolumegroup.ceph.rook.io/"$SUBVOLUME_GROUP" -o jsonpath='{.status.info.clusterID}') + CEPHFS_STORAGE_CLASS_NAME=cephfs-$SUBVOLUME_GROUP fi }