mirror of https://github.com/kubernetes/kops.git
Always returns items sorted by Name
Keeps tests deterministic, seems to be an assumption in the k8s API also.
This commit is contained in:
parent
9e546d7fe0
commit
fca2bccd49
|
@ -27,6 +27,7 @@ import (
|
|||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"os"
|
||||
"reflect"
|
||||
"sort"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
@ -196,6 +197,10 @@ func (c *commonVFS) listNames() ([]string, error) {
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("error listing %s in state store: %v", c.kind, err)
|
||||
}
|
||||
|
||||
// Seems to be an assumption in k8s APIs that items are always returned sorted
|
||||
sort.Strings(keys)
|
||||
|
||||
return keys, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue