Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default workspace is listed twice when using etcdv3 backend #28098

Closed
jasons42 opened this issue Mar 15, 2021 · 1 comment · Fixed by #28099
Closed

Default workspace is listed twice when using etcdv3 backend #28098

jasons42 opened this issue Mar 15, 2021 · 1 comment · Fixed by #28099
Labels
bug new new issue not yet triaged

Comments

@jasons42
Copy link
Contributor

Terraform Version

v0.14.8

Terraform Configuration Files

  backend "etcdv3" {
    endpoints   = ["localhost:2379"]
    prefix      = "test-tf/"
    lock        = true
  }

  required_version = ">= 0.13"
}

Command Output

terraform workspace list 
* default
* default

Expected Behavior

Default workspace should be listed once.

Actual Behavior

Default workspace is listed twice.

Steps to Reproduce

  1. Configure a Terraform config to use the etcdv3 backend
  2. terraform workspace list

Additional Context

This is also caught by the acceptance tests after applying a fix for #28096

TF_ACC=1 TF_ETCDV3_ENDPOINTS=http://127.0.0.1:2379 go test ./backend/remote-state/etcdv3
--- FAIL: TestBackend (0.25s)
    backend_test.go:40: Cleaned up 0 keys.
    backend_test.go:62: TestBackendConfig on *etcd.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"endpoints":cty.TupleVal([]cty.Value{cty.StringVal("http://127.0.0.1:2379")}), "prefix":cty.StringVal("tf-unit/2021-03-15T16:30:34-05:00/")}}
    backend_test.go:67: TestBackendConfig on *etcd.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"endpoints":cty.TupleVal([]cty.Value{cty.StringVal("http://127.0.0.1:2379")}), "prefix":cty.StringVal("tf-unit/2021-03-15T16:30:34-05:00/")}}
    backend_test.go:73: should only have the default workspace to start: []string{"default", "default"}
    backend_test.go:40: Cleaned up 1 keys.
FAIL
FAIL    github.com/hashicorp/terraform/backend/remote-state/etcdv3      4.543s
FAIL
@jasons42 jasons42 added bug new new issue not yet triaged labels Mar 15, 2021
jasons42 added a commit to jasons42/terraform that referenced this issue Mar 15, 2021
The default state is already explicitly added to the result slice. Added
a guard to prevent it being added a second time.

Fixes hashicorp#28098
@ghost
Copy link

ghost commented Apr 17, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Apr 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug new new issue not yet triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants