mirror of https://github.com/kubernetes/kops.git
Fix cluster-autoscaler priority expander config
We were iterating over a map which has undefined ordering, resulting in inconsistent diffs to the manifest during `kops update cluster`. We now sort the instsance groups to ensure the rendered manifest remains consistent.
This commit is contained in:
parent
4008c54823
commit
51530ee8f3
|
|
@ -347,7 +347,9 @@ func (tf *TemplateFunctions) AddTo(dest template.FuncMap, secretStore fi.SecretS
|
|||
if cluster.Spec.ClusterAutoscaler.CustomPriorityExpanderConfig != nil {
|
||||
priorities = cluster.Spec.ClusterAutoscaler.CustomPriorityExpanderConfig
|
||||
} else {
|
||||
for name, spec := range tf.GetNodeInstanceGroups() {
|
||||
igNames := maps.SortedKeys(tf.GetNodeInstanceGroups())
|
||||
for _, name := range igNames {
|
||||
spec := tf.GetNodeInstanceGroups()[name]
|
||||
if spec.Autoscale != nil {
|
||||
priorities[strconv.Itoa(int(spec.AutoscalePriority))] = append(priorities[strconv.Itoa(int(spec.AutoscalePriority))], fmt.Sprintf("%s.%s", name, tf.ClusterName()))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue