feat: support pod-level dns and sysctls on podman pod create#35
Merged
Conversation
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.
Summary
Support
dns,dns_search,dns_opt, andsysctlsby hoisting them ontopodman pod create— the tool's first pod-create flags (every prior feature addedpodman runflags). A new modulecompose2pod/pod.pyaggregates these per-service compose declarations across the target's dependency closure into the single pod. This is the deferred pod-level-aggregation item fromdecisions/2026-07-09-sysctls-pod-level.mdanddeferred.md; bothdns/sysctlswere previously refused.Design:
planning/changes/2026-07-11.03-pod-dns-sysctls.md.Why pod-level
A Podman pod shares one network namespace, so these options cannot be per-container:
--dnsis invalid on a pod-joined container, and the only settable sysctls are namespaced (net/ipc), which the pod owns.podman pod createexposes--dns/--dns-search/--dns-option/--sysctl, each documented (verified againstpodman-pod-create.1) as shared across all containers in the pod — their honest home.dns(str/list)--dnsdns_search(str/list)--dns-searchdns_opt(str/list)--dns-optionsysctls(map /k=vlist)--sysctl key=valueReconciliation
Aggregated across the target's closure (
pod_create_flags(services, order)), because a service outside the closure isn't in the pod:/etc/resolv.confbags; there is no single-value conflict.conflicting sysctl ...), matching theresources.pyconflict pattern. Same key + same value (including1/"1"normalization) or different keys merge.Values render through the existing
_Expand/to_shellpath, so a${VAR}in a dns/sysctl value stays live at run time and feeds thereferenced_variables()note.Pod-wide divergence
These apply to every container in the pod, including services that didn't declare them (inherent to the shared namespace).
validate()emits one warning:dns/sysctls apply pod-wide -- all containers in the pod share one /etc/resolv.conf and sysctl set.Non-goals
Per-service DNS/sysctls (impossible in a shared-namespace pod); last-writer-wins for a sysctl conflict (refused instead).
Testing
just test-ciat 100% coverage (352 tests),just lint-ciclean,just check-planningOK.tests/test_pod.pycovers each key's flag, string/list and map/k=vforms, dns union/dedup across the closure, the sysctl conflict + clean merge, and non-closure exclusion; e2e tests prove the pod-create line and the pod-wide warning. A service with no pod options emits a byte-identicalpodman pod createline.An adversarial whole-branch review ran real inputs — a
$(touch)dns payload is escaped byto_shell(no new injection surface despite the new pod-create line), a genuine sysctl conflict yields a clean exit 2, and a diamondint/strsysctl merges correctly.Planning
Retires the
dns/sysctlsentries indeferred.md(triggers met) and adds a Resolved note todecisions/2026-07-09-sysctls-pod-level.md; new## Pod-level optionssection inarchitecture/supported-subset.md.