You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current version of the provider is built using Go version 1.19.4. With Go version < 1.20, Go is using the internal Go DNS resolver by default which only considers the file /etc/resolv.conf similar to glibc's behaviour. But macOS also supports additional configurations under /etc/resolver which is often used for local development to use proper name resolution.
The behaviour has been changed beginning with Go version 1.20 (see also golang/go#12524)
Upgrading the Go version used to build the provider, will solve this issue.
[DEBUG] provider.terraform-provider-vault: go package net: confVal.netCgo = false netGo = true
[DEBUG] provider.terraform-provider-vault: go package net: built with netgo build tag; using Go's DNS resolver
[DEBUG] provider.terraform-provider-vault: go package net: hostLookupOrder(vault.minikube.test) = files,dns
Resolver used if built with Go version 1.20.6
[DEBUG] provider.terraform-provider-vault: go package net: confVal.netCgo = false netGo = false
[DEBUG] provider.terraform-provider-vault: go package net: using cgo DNS resolver
[DEBUG] provider.terraform-provider-vault: go package net: hostLookupOrder(vault.minikube.test) = cgo
Expected Behavior
The provider should lookup the host address using cgo DNS resolver on macOS in order to correctly resolve the address with the local resolver.
Actual Behavior
The provider is using Go's DNS resolver and thus fails to resolve the local host:
│ Error: failed to lookup token, err=Get "http://vault.minikube.test/v1/auth/token/lookup-self": dial tcp: lookup vault.minikube.test on 192.168.178.1:53: no such host
│
│ with provider["registry.terraform.io/hashicorp/vault"],
│ on provider.tf line 31, in provider "vault":
│ 31: provider "vault" {
│
... while the name resolution actually works with other utils:
$ dscacheutil -q host -a name vault.minikube.test
name: vault.minikube.test
ip_address: 192.168.64.18
Steps to Reproduce
Start minikube with addon ingress-dns on macOS
Create a vault application using a custom ingress configuration with a local host configured
Configure a custom domain resolution configuration under /etc/resolver
Try to connect to the vault instance with the previously configured hostname
With Go version < 1.20, Go is using the internal Go DNS resolver by default
which only considers the file /etc/resolv.conf similar to glibc's behaviour.
But macOS also supports additional configurations under /etc/resolver which
is often used for local development to use proper name resolution.
The behaviour has been changed beginning with Go version 1.20
(see also https://go-review.googlesource.com/c/go/+/446178)
Fixeshashicorp#1940
With Go version < 1.20, Go is using the internal Go DNS resolver by default
which only considers the file /etc/resolv.conf similar to glibc's behaviour.
But macOS also supports additional configurations under /etc/resolver which
is often used for local development to use proper name resolution.
The behaviour has been changed beginning with Go version 1.20
(see also https://go-review.googlesource.com/c/go/+/446178)
Fixes#1940
The current version of the provider is built using Go version 1.19.4. With Go version < 1.20, Go is using the internal Go DNS resolver by default which only considers the file
/etc/resolv.conf
similar to glibc's behaviour. But macOS also supports additional configurations under/etc/resolver
which is often used for local development to use proper name resolution.The behaviour has been changed beginning with Go version 1.20 (see also golang/go#12524)
Upgrading the Go version used to build the provider, will solve this issue.
Terraform Version
Terraform Configuration Files
Debug Output
Resolver used if built with Go version 1.19.4
Resolver used if built with Go version 1.20.6
Expected Behavior
The provider should lookup the host address using cgo DNS resolver on macOS in order to correctly resolve the address with the local resolver.
Actual Behavior
The provider is using Go's DNS resolver and thus fails to resolve the local host:
... while the name resolution actually works with other utils:
Steps to Reproduce
ingress-dns
on macOS/etc/resolver
References
The text was updated successfully, but these errors were encountered: