Skip to content

Commit

Permalink
make configmap load in alphabetical order
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-chenzz committed Sep 19, 2023
1 parent 59696d1 commit d118fe2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions kyaml/yaml/datamap.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ import (
// Writing this function never gets old.
func SortedMapKeys(m map[string]string) []string {
keys := make([]string, len(m))
i := 0
for k := range m {
keys[i] = k
i++
keys = append(keys, k)

Check failure on line 18 in kyaml/yaml/datamap.go

View workflow job for this annotation

GitHub Actions / Lint

append to slice `keys` with non-zero initialized length (makezero)
}
sort.Strings(keys)
return keys
Expand Down

0 comments on commit d118fe2

Please sign in to comment.