Skip to content

Commit

Permalink
Merge pull request #2841 from OdedViner/bz-2315464
Browse files Browse the repository at this point in the history
Adjust Node Label Conditions Based on Full Label Name
  • Loading branch information
openshift-merge-bot[bot] authored Oct 18, 2024
2 parents 5f8a3ed + 4d3a134 commit 2a2fdb2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions controllers/storagecluster/topology.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func setFailureDomain(sc *ocsv1.StorageCluster) {
// If sufficient zones are available then we select zone as the failure domain
topologyMap := sc.Status.NodeTopologies
for label, labelValues := range topologyMap.Labels {
if strings.Contains(label, "zone") {
if label == corev1.LabelZoneFailureDomainStable || label == labelZoneFailureDomainWithoutBeta {
if (len(labelValues) >= 2 && arbiterEnabled(sc)) || (len(labelValues) >= 3) {
failureDomain = "zone"
}
Expand Down Expand Up @@ -135,7 +135,7 @@ func determinePlacementRack(
targetAZ := ""
for label, value := range node.Labels {
for _, key := range validTopologyLabelKeys {
if strings.Contains(label, key) && strings.Contains(label, "zone") {
if strings.Contains(label, key) && (label == corev1.LabelZoneFailureDomainStable || label == labelZoneFailureDomainWithoutBeta) {
targetAZ = value
break
}
Expand All @@ -159,7 +159,7 @@ func determinePlacementRack(
if n.Name == nodeName {
for label, value := range n.Labels {
for _, key := range validTopologyLabelKeys {
if strings.Contains(label, key) && strings.Contains(label, "zone") && value == targetAZ {
if strings.Contains(label, key) && (label == corev1.LabelZoneFailureDomainStable || label == labelZoneFailureDomainWithoutBeta) && value == targetAZ {
validRack = true
break
}
Expand Down

0 comments on commit 2a2fdb2

Please sign in to comment.