Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust Node Label Conditions Based on Full Label Name #2841

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading