Skip to content

Conversation

Kump3r
Copy link
Contributor

@Kump3r Kump3r commented Jul 23, 2025

Changes proposed by this PR

Based on #6549, we want to maintain the adopt the functionally of adding additional DNS host entries to the /etc/hosts file of the container.

Notes to reviewer

N/A

Copy link
Member

@taylorsilva taylorsilva left a comment

Choose a reason for hiding this comment

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

Wow, so easy! Was looking to see when /etc/hosts gets added to the file store and found it here:

etcHosts, err := n.store.Create(
filepath.Join(handle, "/hosts"),
[]byte("127.0.0.1 localhost\n"),
)
if err != nil {
return nil, fmt.Errorf("creating /etc/hosts: %w", err)
}

This looks good! Add the tests and this will be good to merge 🚀

@taylorsilva
Copy link
Member

Thanks for doing all the packaging stuff as well! ❤️

@ceco556 ceco556 force-pushed the additional-dns branch 4 times, most recently from 72f05cb to 10cb05c Compare July 24, 2025 10:42
Kump3r and others added 3 commits July 24, 2025 13:52
Signed-off-by: Kump3r <tonevkalin@gmail.com>
Signed-off-by: Kump3r <tonevkalin@gmail.com>
Signed-off-by: ceco556 <ceco456@gmail.com>
@Kump3r Kump3r marked this pull request as ready for review July 24, 2025 10:57
@Kump3r Kump3r requested a review from a team as a code owner July 24, 2025 10:57
Copy link
Contributor

@IvanChalukov IvanChalukov left a comment

Choose a reason for hiding this comment

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

I’ve tested this locally and it behaves as expected. Nice job! I’ve added a few small suggestions around error handling to help make it a bit more resilient.

Kump3r added 2 commits July 25, 2025 00:15
Signed-off-by: Kump3r <tonevkalin@gmail.com>
Signed-off-by: Kump3r <tonevkalin@gmail.com>
@Kump3r
Copy link
Contributor Author

Kump3r commented Jul 25, 2025

Thanks for your feedback, we considered all of them previously as I mentioned, so it was a no brainer in adding them. It was just after a long day, so I totally messed up the previous unit tests 😅

@Kump3r
Copy link
Contributor Author

Kump3r commented Jul 25, 2025

You are absolutely right, when I was adjusting the tests, I switched the order and didn't think it matters as I forgot I already prepared the other packaging stuff. Nice catch!

…ng missed test for IP verification failures

Signed-off-by: Kump3r <tonevkalin@gmail.com>
@Kump3r Kump3r requested a review from IvanChalukov July 25, 2025 12:28
Copy link
Contributor

@IvanChalukov IvanChalukov left a comment

Choose a reason for hiding this comment

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

Tested locally with the following configurations:

  • No CONCOURSE_CONTAINERD_ADDITIONAL_HOSTS set → ✅ no changes to containers, behaves as expected
  • Invalid values: CONCOURSE_CONTAINERD_ADDITIONAL_HOSTS: 1.2.3.4 example.com,5.6.7.8.1 another-example.com → ✅ fails to create container and print appropriate error message
  • Valid values: CONCOURSE_CONTAINERD_ADDITIONAL_HOSTS: 1.2.3.4 example.com,5.6.7.8 another-example.com → ✅ entries applied successfully to containers

Everything works as expected from my perspective - nice work!

@taylorsilva taylorsilva added this to the v7.14.0 milestone Jul 25, 2025
@taylorsilva taylorsilva moved this from Todo to In Progress in Pull Requests Jul 25, 2025
@Kump3r Kump3r requested a review from taylorsilva July 27, 2025 06:47
Signed-off-by: Taylor Silva <dev@taydev.net>
Copy link
Member

@taylorsilva taylorsilva left a comment

Choose a reason for hiding this comment

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

Quickly repeated Ivan's tests and got the same results. I added an additional commit that clarifies the format we expect the IP and hostname to be passed in with.

Will let the PR checks go through one last time and then merge.

@Kump3r
Copy link
Contributor Author

Kump3r commented Jul 27, 2025

Thanks guys! Feel free to check the packaging stuff as they should be pretty straightforward as well.

@taylorsilva taylorsilva merged commit dc67a49 into concourse:master Jul 28, 2025
12 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Pull Requests Jul 28, 2025
@taylorsilva taylorsilva changed the title containerd: add flag to add addintional-hosts containerd: add flag to add additional-hosts Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants