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

Add /etc/nsswitch.conf for /etc/hosts name resolution #1251

Merged
merged 1 commit into from
May 20, 2020

Conversation

yw-liu
Copy link
Contributor

@yw-liu yw-liu commented May 7, 2020

Description

Add nsswitch.conf to the /etc/ folder of the executor image, this is for situations such as a user configures static host-ip mappings in /etc/hosts.

@googlebot googlebot added the cla: yes CLA signed by all commit authors label May 7, 2020
@tstromberg
Copy link
Contributor

Hi @yw-liu - Do you mind updating the PR description to describe the problem you are trying to solve, and why this is the best way to fix it?

Specifically: what is the situation you've seen where the kaniko container needs access to /etc/hosts? Are you trying to make it so that Kaniko can access a registry that is not in DNS?

I suspect you may be trying to workaround the unusual behavior where Go, and other implementations, try to use DNS first if /etc/hosts is missing, but I can't tell just yet: golang/go#35305

Other than improving the PR description, the file looks fine and I would be OK with merging this.

@@ -0,0 +1,20 @@
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this comment, and instead make the comment describe why an nsswitch.conf is provided.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your advice, the comment is updated.

@tstromberg tstromberg changed the title add nsswitch.conf Add /etc/nsswitch.conf for /etc/hosts name resolution May 20, 2020
@tstromberg tstromberg merged commit 885c4da into GoogleContainerTools:master May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes CLA signed by all commit authors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants