Skip to content

Commit 3a2b453

Browse files
kishorjTimothy-Dougherty
authored andcommitted
sort targetgroup attrs (kubernetes-sigs#1971)
1 parent fa81ae9 commit 3a2b453

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/service/model_build_target_group.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"sigs.k8s.io/aws-load-balancer-controller/pkg/annotations"
1717
"sigs.k8s.io/aws-load-balancer-controller/pkg/k8s"
1818
elbv2model "sigs.k8s.io/aws-load-balancer-controller/pkg/model/elbv2"
19+
"sort"
1920
"strconv"
2021
"strings"
2122
)
@@ -216,6 +217,9 @@ func (t *defaultModelBuildTask) buildTargetGroupAttributes(_ context.Context) ([
216217
Value: attrValue,
217218
})
218219
}
220+
sort.Slice(attributes, func(i, j int) bool {
221+
return attributes[i].Key < attributes[j].Key
222+
})
219223
return attributes, nil
220224
}
221225

0 commit comments

Comments
 (0)