From b896348230c3ac407c914f92fc6ba8fe4e296a6b Mon Sep 17 00:00:00 2001 From: Bruno Miguel Custodio Date: Fri, 8 Sep 2017 12:25:15 +0100 Subject: [PATCH] Sort the result of 'Backend.States()'. --- backend/remote-state/etcdv3/backend_state.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/remote-state/etcdv3/backend_state.go b/backend/remote-state/etcdv3/backend_state.go index 7e26cf27d..358a95295 100644 --- a/backend/remote-state/etcdv3/backend_state.go +++ b/backend/remote-state/etcdv3/backend_state.go @@ -3,6 +3,7 @@ package etcd import ( "context" "fmt" + "sort" "strings" etcdv3 "github.com/coreos/etcd/clientv3" @@ -33,6 +34,7 @@ func (b *Backend) States() ([]string, error) { for _, kv := range res.Kvs { result = append(result, strings.TrimPrefix(string(kv.Key), prefix)) } + sort.Strings(result[1:]) return result, nil }