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 20, 2023
1 parent 59696d1 commit e0640ed
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions kyaml/yaml/datamap.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ import (
// SortedMapKeys returns a sorted slice of keys to the given map.
// Writing this function never gets old.
func SortedMapKeys(m map[string]string) []string {
keys := make([]string, len(m))
i := 0
keys := make([]string, 0, len(m))
for k := range m {
keys[i] = k
i++
keys = append(keys, k)
}
sort.Strings(keys)
return keys
Expand Down

0 comments on commit e0640ed

Please sign in to comment.