mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 13:45:06 +00:00
Update generated code to stable order
This commit is contained in:
@@ -28,6 +28,7 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"sort"
|
||||
"text/template"
|
||||
"time"
|
||||
|
||||
@@ -1110,7 +1111,14 @@ func Test{{.Service}}Group(t *testing.T) {
|
||||
}
|
||||
`
|
||||
tmpl := template.Must(template.New("unittest").Parse(text))
|
||||
for _, s := range meta.AllServicesByGroup {
|
||||
// Sort keys so the output will be stable.
|
||||
var keys []string
|
||||
for k, _ := range meta.AllServicesByGroup {
|
||||
keys = append(keys, k)
|
||||
}
|
||||
sort.Strings(keys)
|
||||
for _, k := range keys {
|
||||
s := meta.AllServicesByGroup[k]
|
||||
if err := tmpl.Execute(wr, s); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user