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

fix: localhost not being resolved. Resolves #4460, #3564 #4461

Merged
merged 1 commit into from
Nov 5, 2020

Conversation

mikechau
Copy link
Contributor

@mikechau mikechau commented Nov 5, 2020

Add nsswitch.conf to resolve hosts in /etc/hosts. When cgo is disabled argo server is unable to resolve localhost. Go will fallback to check /etc/nsswitch.conf. We set nsswitch.conf to first check /etc/hosts and then dns.

@CLAassistant
Copy link

CLAassistant commented Nov 5, 2020

CLA assistant check
All committers have signed the CLA.

@alexec
Copy link
Contributor

alexec commented Nov 5, 2020

Excellent. Can you share an example of someone else doing this? Or the reason for this approach?

  • Please sign your commit.
  • Please update the commit message to be semantic.



Add nsswitch.conf to resolve hosts in /etc/hosts

Signed-off-by: Mike Chau <mikechau@users.noreply.github.com>
@mikechau mikechau changed the title Resolves #4460, #3564 fix: localhost not being resolved. Resolves #4460, #3564 Nov 5, 2020
@mikechau
Copy link
Contributor Author

mikechau commented Nov 5, 2020

Hi @alexec, see: golang/go#22846 (comment) and golang/go#22846 (comment) for the reasoning.

We run Kubernetes on-premises and the argocli image w/ argo server didn't work for us. Enabling the cgo dns resolver or setting the /etc/nsswitch.conf with hosts: files dns did fix the issue however. When cgo is disabled, Go will fallback to /etc/nsswitch.conf to decide how to handle DNS lookups and since argocli uses scratch as its base image, I suspect it does not include a /etc/nsswitch.conf file.

Some additional prior art:

docker-library/docker#82
docker-library/docker#84

@alexec alexec merged commit 42d0605 into argoproj:master Nov 5, 2020
@alexec alexec added this to the v2.12 milestone Nov 5, 2020
alexcapras pushed a commit to alexcapras/argo that referenced this pull request Nov 12, 2020
 (argoproj#4461)

Signed-off-by: Mike Chau <mikechau@users.noreply.github.com>
Signed-off-by: Alex Capras <alexcapras@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants