Skip to content

Add IsolatedDebugPlatform with DNS field backfill - #4998

Merged
willmyrs merged 1 commit into
aws:devfrom
willmyrs:backfill-dns-debug
Jun 10, 2026
Merged

willmyrs merged 1 commit into
aws:devfrom
willmyrs:backfill-dns-debug

Conversation

@willmyrs

@willmyrs willmyrs commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

When the ACS payload omits DomainNameServers, netlib copies the host's resolv.conf into the task volume but leaves the interface struct fields empty. This adds an IsolatedDebugPlatform that parses the copied resolv.conf back into the interface fields so the model reflects the DNS config that containers actually use. The backfill is scoped to the isolated debug platform.

Implementation details

Add a new IsolatedDebugPlatform constant and isolatedDebug struct that embeds containerd. Its CreateDNSConfig method delegates to createDNSConfig, then—when the primary interface has no DomainNameServers—reads the resolv.conf that was just copied and backfills the interface fields.

The parser (parseResolvConf) is added to common_linux.go and follows resolv.conf(5) using the same rules as Go's net.dnsReadConfig:

  • Lines starting with ; or # are comments
  • Fields split on any whitespace
  • nameserver contributes one IP per line
  • Last search directive wins

The platform factory in NewPlatform routes IsolatedDebugPlatform to the new struct.

Testing

Unit tests for parseResolvConf covering:

  • Go stdlib test fixture (IPv4, IPv6, zone-scoped nameservers, mixed directives)
  • Semicolon and hash comments
  • Tabs and multiple spaces as separators
  • Last-search-wins semantics
  • Empty input and unknown directives

New tests cover the changes: yes

Description for the changelog

Enhancement - Add IsolatedDebugPlatform with DNS field backfill from host resolv.conf

Additional Information

Does this PR include breaking model changes? If so, Have you added transformation functions?

No. This adds a new platform type. DomainNameServers and DomainNameSearchList are []string with json:",omitempty" — consumers already handle both nil and populated cases.

Does this PR include the addition of new environment variables in the README?

No.

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@willmyrs
willmyrs marked this pull request as ready for review June 10, 2026 16:37
@willmyrs
willmyrs requested a review from a team as a code owner June 10, 2026 16:37
When the ACS payload omits DomainNameServers, netlib copies the host's
resolv.conf but leaves the interface struct fields empty.

Introduce an IsolatedDebugPlatform that overrides CreateDNSConfig to
parse the copied resolv.conf back into the interface fields so the
model reflects the DNS config that containers actually use. The
backfill is scoped to the isolated debug platform.
@willmyrs
willmyrs merged commit 5ab2652 into aws:dev Jun 10, 2026
45 of 46 checks passed
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.

4 participants