diff --git a/controllers/storagecluster/external_resources.go b/controllers/storagecluster/external_resources.go index 610769eb85..94ddc09307 100644 --- a/controllers/storagecluster/external_resources.go +++ b/controllers/storagecluster/external_resources.go @@ -25,15 +25,15 @@ import ( ) const ( - externalClusterDetailsSecret = "rook-ceph-external-cluster-details" - externalClusterDetailsKey = "external_cluster_details" - cephFsStorageClassName = "cephfs" - cephRbdStorageClassName = "ceph-rbd" - cephRbdRadosNamespaceStorageClassName = "ceph-rbd-rados-namespace" - cephRbdTopologyStorageClassName = "ceph-rbd-topology" - cephRgwStorageClassName = "ceph-rgw" - externalCephRgwEndpointKey = "endpoint" - cephRgwTLSSecretKey = "ceph-rgw-tls-cert" + externalClusterDetailsSecret = "rook-ceph-external-cluster-details" + externalClusterDetailsKey = "external_cluster_details" + cephFsStorageClassName = "cephfs" + cephRbdStorageClassName = "ceph-rbd" + cephRbdRadosNamespaceStorageClassNamePrefix = "ceph-rbd-rados-namespace" + cephRbdTopologyStorageClassName = "ceph-rbd-topology" + cephRgwStorageClassName = "ceph-rgw" + externalCephRgwEndpointKey = "endpoint" + cephRgwTLSSecretKey = "ceph-rgw-tls-cert" ) const ( @@ -375,7 +375,7 @@ func (r *StorageClusterReconciler) createExternalStorageClusterResources(instanc enableRookCSICephFS = true } else if d.Name == cephRbdStorageClassName { scc = newCephBlockPoolStorageClassConfiguration(instance) - } else if d.Name == cephRbdRadosNamespaceStorageClassName { + } else if strings.HasPrefix(d.Name, cephRbdRadosNamespaceStorageClassNamePrefix) { // ceph-rbd-rados-namespace- scc = newCephBlockPoolStorageClassConfiguration(instance) // update the storageclass name to rados storagesclass name scc.storageClass.Name = fmt.Sprintf("%s-%s", instance.Name, d.Name)