helm: helm failed to resolve on osx when cgo_enabled false

Hi guys, after https://github.com/helm/helm/commit/3490f1e7b6d76709b7ea195370f7db463735f9e2#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52R80

helm stopped working with osx /etc/resolver/* files. It was very useful in case of corporate VPN dns resolving.

https://github.com/golang/go/issues/12524

> helm list --all
Error: Kubernetes cluster unreachable: Get "https://<k8s_server>:8443/k8s/clusters/c-pkq2n/version": dial tcp: lookup <k8s_server> on <external_dns_instead_of_corporate>:53: no such host

Output of helm version: version.BuildInfo{Version:"v3.8.2", GitCommit:"6e3701edea09e5d55a8ca2aae03a68917630e91b", GitTreeState:"clean", GoVersion:"go1.18.1"}

Output of kubectl version:

Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.5", GitCommit:"c285e781331a3785a7f436042c65c5641ce8a9e9", GitTreeState:"clean", BuildDate:"2022-03-16T15:51:05Z", GoVersion:"go1.17.8", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.8", GitCommit:"5575935422cc1cf5169dfc8847cb587aa47bac5a", GitTreeState:"clean", BuildDate:"2021-06-16T12:53:07Z", GoVersion:"go1.15.13", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (1.23) and server (1.20) exceeds the supported minor version skew of +/-1

Also I’ve found that os x binaries on https://github.com/helm/helm/releases are built with build-cross make target (as far I can guess) which differ from helm install binary.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 17 (7 by maintainers)

Most upvoted comments

@joejulian the downstream helm brew formula has never explicitly specified CGO_ENABLED, and only used our default make build.

The problem was actually caused by us forcing CGO_ENABLED=0 in commit https://github.com/helm/helm/commit/3490f1e7b6d76709b7ea195370f7db463735f9e2 (released in helm 3.8.2).

To fix this, we either need to expose a method of setting CGO_ENABLED=1 in our make build or revert CGO_ENABLED to be 1 by default (as it was for helm 3.8.1 and before).

Note that the build for kubectl automatically detects that a build is happening on darwin and enables CGO, we should do the same.

I’m not sure if the same applies to VPNs on Linux.

As i mentioned in: https://github.com/helm/helm/issues/10874#issuecomment-1101741929 I have the same issue in my Arch Linux environment, reverting back to 3.8.1 solved my issue with connecting to my private AKS with twingate(VPN).