Skip to content

Commit

Permalink
Code review fixes for topology_spread_constraints
Browse files Browse the repository at this point in the history
Signed-off-by: Aurel Canciu <aurel.canciu@nexhealth.com>
  • Loading branch information
relu committed Oct 16, 2024
1 parent 257e25b commit e600832
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions pkg/operator/contenthash/topology_spread_constraints.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package contenthash
import (
"crypto/md5"
"encoding/hex"
"fmt"
"strings"

corev1 "k8s.io/api/core/v1"
Expand All @@ -45,11 +44,9 @@ func TopologySpreadConstraints(in []corev1.TopologySpreadConstraint) string {
}
writeStringHash(h, StringMap(labelSelectors))
writeStringHash(h, strings.Join(tsc.MatchLabelKeys, ""))
minDomainsSeconds := "nil"
if tsc.MinDomains != nil {
minDomainsSeconds = fmt.Sprint(*tsc.MinDomains)
writeStringHash(h, string(*tsc.MinDomains))
}
writeStringHash(h, minDomainsSeconds)
if tsc.NodeAffinityPolicy != nil {
writeStringHash(h, string(*tsc.NodeAffinityPolicy))
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2020 PlanetScale Inc.
Copyright 2024 PlanetScale Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down

0 comments on commit e600832

Please sign in to comment.