Resolve /etc/hosts before DNS by default
Adds a simple /etc/nsswitch.conf
to make netgo's hostname resolution to
be more in line with user expectations.
See gitlab-org/gitlab#232737 (comment 393748211)
Manual QA
Before
$ docker run --rm -it registry.gitlab.com/gitlab-org/cluster-integration/helm-install-image/releases/2.16.9-kube-1.13.12
/ # echo 127.0.0.1 google.com >> /etc/hosts
/ # export HELM_HOST=google.com:44134
/ # tiller -listen $HELM_HOST -alsologtostderr &
/ # [main] 2020/08/10 23:34:00 Server died: listen tcp 172.217.165.14:44134: bind: cannot assign requested address
After
$ docker run --rm -it registry.gitlab.com/gitlab-org/cluster-integration/helm-install-image/branches/fix-netgo-etc-hosts-vs-dns:dfc1d37ddcd781f3ca3e41aac10639ae3261c266-helm2 sh
/ # echo 127.0.0.1 google.com >> /etc/hosts
/ # export HELM_HOST=google.com:44134
/ # tiller -listen $HELM_HOST -alsologtostderr &
/ # [main] 2020/08/11 01:16:51 Starting Tiller v2.16.9 (tls=false)
[main] 2020/08/11 01:16:51 GRPC listening on google.com:44134
[main] 2020/08/11 01:16:51 Probes listening on :44135
[main] 2020/08/11 01:16:51 Storage driver is ConfigMap
[main] 2020/08/11 01:16:51 Max history per release is 0
Edited by Hordur Freyr Yngvason