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

etcdv3 backend acceptance tests fail due to invalid type conversion #28096

Closed
jasons42 opened this issue Mar 15, 2021 · 2 comments · Fixed by #28097
Closed

etcdv3 backend acceptance tests fail due to invalid type conversion #28096

jasons42 opened this issue Mar 15, 2021 · 2 comments · Fixed by #28097
Labels
bug new new issue not yet triaged

Comments

@jasons42
Copy link
Contributor

jasons42 commented Mar 15, 2021

Test Failure Output

FAIL: TestBackend (0.04s)
    backend_test.go:40: Cleaned up 0 keys.
    backend_test.go:40: Cleaned up 0 keys.
panic: can't convert []string{"http://127.0.0.1:2379"} to cty.Value [recovered]
        panic: can't convert []string{"http://127.0.0.1:2379"} to cty.Value

goroutine 7 [running]:
testing.tRunner.func1.2(0x19a5aa0, 0xc0004d9150)
        /usr/local/Cellar/go/1.16.2/libexec/src/testing/testing.go:1144 +0x332
testing.tRunner.func1(0xc000412300)
        /usr/local/Cellar/go/1.16.2/libexec/src/testing/testing.go:1147 +0x4b6
panic(0x19a5aa0, 0xc0004d9150)
        /usr/local/Cellar/go/1.16.2/libexec/src/runtime/panic.go:965 +0x1b9
github.com/hashicorp/terraform/configs/hcl2shim.HCL2ValueFromConfigValue(0x196bda0, 0xc000482120, 0x1ac52cf, 0x6, 0xc0001e5d40, 0xc0004d9130)
        /Users/jsmith/dev/github.com/terraform/configs/hcl2shim/values.go:228 +0x7f7
github.com/hashicorp/terraform/configs/hcl2shim.HCL2ValueFromConfigValue(0x19b8060, 0xc0004a24b0, 0x2500000000000000, 0xc0001e5ea0, 0x25653c42b032cb7b, 0x10)
        /Users/jsmith/dev/github.com/terraform/configs/hcl2shim/values.go:222 +0x1d7
github.com/hashicorp/terraform/backend.TestWrapConfig(0xc0004a24b0, 0xc0004a24b0, 0x1ac52cf)
        /Users/jsmith/dev/github.com/terraform/backend/testing.go:66 +0x3b
github.com/hashicorp/terraform/backend/remote-state/etcdv3.TestBackend(0xc000412300)
        /Users/jsmith/dev/github.com/terraform/backend/remote-state/etcdv3/backend_test.go:62 +0x27d
testing.tRunner(0xc000412300, 0x1b0d508)
        /usr/local/Cellar/go/1.16.2/libexec/src/testing/testing.go:1194 +0xef
created by testing.(*T).Run
        /usr/local/Cellar/go/1.16.2/libexec/src/testing/testing.go:1239 +0x2b3
FAIL    github.com/hashicorp/terraform/backend/remote-state/etcdv3      0.481s
FAIL

Expected Behavior

Acceptance tests should pass when run against a fresh etcdv3 instance.

Actual Behavior

Acceptance tests fail due to an invalid type conversion.

Steps to Reproduce

  1. helm install etcd bitnami/etcd --set auth.rbac.enabled=false (installed in Minikube)
  2. kubectl port-forward --namespace default svc/etcd 2379:2379
  3. TF_ACC=1 TF_ETCDV3_ENDPOINTS=http://127.0.0.1:2379 go test ./backend/remote-state/etcdv3
@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
etcdv3 acceptance tests fail due to attempting to pass slices of strings
for the endpoints config to HCL2ValueFromConfigValue() which does not
handle that type.

Not a pretty solution but a helper function that converts the endpoints to a slice of
empty interfaces satisfies the requirements of the
HCL2ValueFromConfigValue function.

fixes hashicorp#28096
@jasons42
Copy link
Contributor Author

Also as a sidenote, is it expected that the etcdv3 acceptance tests do not run when opening a PR that modifies the etcd package?

@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