Merge pull request #28099 from jasons42/duplicate-default-workspace

Fix duplicate default state
This commit is contained in:
James Bardin 2021-03-17 14:11:04 -04:00 committed by GitHub
commit 2e3aa96988
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -23,8 +23,10 @@ func (b *Backend) Workspaces() ([]string, error) {
result := make([]string, 1, len(res.Kvs)+1)
result[0] = backend.DefaultStateName
for _, kv := range res.Kvs {
if strings.TrimPrefix(string(kv.Key), b.prefix) != backend.DefaultStateName {
result = append(result, strings.TrimPrefix(string(kv.Key), b.prefix))
}
}
sort.Strings(result[1:])
return result, nil