Repository navigation
fix: DNS resolution for Ubuntu 24 stemcells - #9565
Merged
Merged
Conversation
…ing logic and adding tests Signed-off-by: Kump3r <[email protected]>
|
|
Contributor
Author
|
Well the |
Member
|
Thanks Kalin! Fine with getting this into v8.2.0 Yeah that flaky test error is so weird. I re-deployed the workers last night which always causes this issue. I don't know why, but when re-deployed we'll see this error, but after a few hours it just stops, as if someone ran |
Member
|
Yup and now it just worked! Weirdddddd Will review and merge shortly. |
taylorsilva
approved these changes
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix DNS resolution on Ubuntu 24 (Noble) stemcells
Problem
On Concourse workers with Ubuntu Noble (24.04) stemcells, container DNS resolution was failing with:
Root Cause
Upstream resolv.conf behavior changed between Ubuntu Jammy and Noble:
/etc/resolv.confdirectly contained a routable DNS IP (e.g.,nameserver 172.18.96.9)/etc/resolv.confis now a systemd-resolved stub resolver symlink with only loopback nameservers:Concourse's DNS parser issue:
The regex patterns in
worker/runtime/resolvconf_parser.goonly matched IPv4 loopback (127.0.0.x), not IPv6 loopback (::1). When systemd-resolved's stub was detected as loopback-only, the parser would:localip.LocalIP()(the worker VM IP)/etc/resolv.conf[::1]:53, which didn't exist, causing connection refusedSolution
Updated
worker/runtime/resolvconf_parser.goto:127.0.0.xand::1are now recognized as loopback and handled uniformly/etc/resolv.confis loopback-only on Noble, parser now:/run/systemd/resolve/resolv.conf/etc/resolv.confcontains any usable non-loopback nameserver, it passes through unchanged (Jammy behavior preserved)Changes
Modified Files
worker/runtime/resolvconf_parser.goloopbackNameserverRegexpto match both127.0.0.xand::1with multiline modeloopbackIPRegexpto strip both IPv4 and IPv6 loopbacksystemdResolvedResolvConfPathconstant pointing to systemd upstream resolv.confreadFileFn,localIPFn) for deterministic testing without exporting test-only APIsworker/runtime/resolvconf_parser_internal_test.go(new file)Why Separate Test File?
The internal tests need access to unexported helpers (
readFileFn,localIPFn, default path constants) to stub I/O deterministically. Placing them in packageruntime(notruntime_test) allows this without polluting the public API. The existingresolvconf_parser_test.goremains in packageruntime_testfor black-box behavior validation.Testing
ginkgo -r ./worker/runtimeBehavior Summary
/etc/resolv.conf[::1]:53→ connection refusedBackward Compatibility
/etc/resolv.confare unaffectedRelated Issue
This fixes DNS resolution failures introduced by Ubuntu 24's systemd-resolved stub resolver changes for Concourse workers on Noble stemcells.