From 403420221419555b50f4f2e707518369e8d1e727 Mon Sep 17 00:00:00 2001 From: Malay Kumar Parida Date: Wed, 21 Dec 2022 17:07:59 +0000 Subject: [PATCH] set domainLabel to "hostname" in topology constrained pool Normally the label on the nodes is of the form kubernetes.io/hostname= and the same is passed to ceph-csi through rook-ceph-opeartor-config cm. Hence, the domainLabel should be set as "hostname" instead of "host" for topology constrained pools. Signed-off-by: Malay Kumar Parida --- controllers/storagecluster/storageclasses.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/controllers/storagecluster/storageclasses.go b/controllers/storagecluster/storageclasses.go index 6e40b7a299..556f018e93 100644 --- a/controllers/storagecluster/storageclasses.go +++ b/controllers/storagecluster/storageclasses.go @@ -443,11 +443,18 @@ func getTopologyConstrainedPools(initData *ocsv1.StorageCluster) string { var topologyConstrainedPools []topologyConstrainedPool for _, failureDomainValue := range initData.Status.FailureDomainValues { + failureDomain := initData.Status.FailureDomain + // Normally the label on the nodes is of the form kubernetes.io/hostname= + // and the same is passed to ceph-csi through rook-ceph-opeartor-config cm. + // Hence, the ceph-non-resilient-rbd storageclass needs to have domainLabel set as hostname for topology constrained pools. + if failureDomain == "host" { + failureDomain = "hostname" + } topologyConstrainedPools = append(topologyConstrainedPools, topologyConstrainedPool{ PoolName: generateNameForNonResilientCephBlockPool(initData, failureDomainValue), DomainSegments: []topologySegment{ { - DomainLabel: initData.Status.FailureDomain, + DomainLabel: failureDomain, DomainValue: failureDomainValue, }, },