feat(template): Ensure entries have a stable order

Signed-off-by: Cristian Klein <cristian.klein@elastisys.com>
pull/7118/head
Cristian Klein 6 years ago
parent 4759ff3ccc
commit 74228eb3ab

@ -140,7 +140,11 @@ func (k *kindSorter) Less(i, j int) bool {
if a.Head.Kind != b.Head.Kind { if a.Head.Kind != b.Head.Kind {
return a.Head.Kind < b.Head.Kind return a.Head.Kind < b.Head.Kind
} }
return first < second if a.Name != b.Name {
return a.Name < b.Name
}
// if same kind in same file, then sort by name to ensure a stable order
return a.Head.Metadata.Name < b.Head.Metadata.Name
} }
// unknown kind is last // unknown kind is last
if !aok { if !aok {

Loading…
Cancel
Save