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
containerd: properly populate /etc/hosts and /etc/hostname #7041
Conversation
The hostname is the container's handle. This is now added to /etc/hostname. Both the hostname and the container's IP is appended to /etc/hosts. The container's IP is only available once the network has been initialized. Therefore, the original /etc/hosts has to be updated after. The /etc/hosts on the container is bindmounted to a file on the worker. We simply update this file directly. issue#6811 Co-authored-by: Muntasir Chowdhury <mchowdhury@pivotal.io> Signed-off-by: Bohan Chen <bochen@pivotal.io>
Use already provided s.GardenBackend instead of creating custom backend. Remove println used for debugging. Signed-off-by: Muntasir Chowdhury <mchowdhury@pivotal.io> Signed-off-by: Muntasir Chowdhury <muntasir.mzc@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks! Good eye with the test cleanup suggestions. |
would it be possible to get this included in the next point release? |
@taylorsilva Do you know when this is planned to be released? |
Soon maybe? Looking at our milestone: https://github.com/concourse/concourse/milestone/75 |
@jaredstehler , |
It did. We have installed it already and tested it fixes the issue we were having 👍 |
Changes proposed by this PR
cc: @chenbh
closes #6811
/etc/hostname
/etc/hosts
Notes to reviewer
The container's IP is only available once the network has been initialized. Therefore, the original /etc/hosts has to be updated after. The /etc/hosts on the container is bindmounted to a file on the worker. We simply update this
file directly.
To test simply jump on to a running container and open the
/etc/hosts
and/etc/hostname
file. You can also runhostname -f
andhostname -i
to validate.Release Note
/etc/hosts
and/etc/hostname
are correctly populated