mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Sort the result of 'Backend.States()'.
This commit is contained in:
parent
70aad79b6e
commit
b896348230
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user