Skip to content

Follow sdk.container_args alone for the distro loopback decision - #391

Closed
jetm wants to merge 4 commits into
feed-loop/feed-preflightfrom
feed-loop/distro-loopback-coherence
Closed

jetm wants to merge 4 commits into
feed-loop/feed-preflightfrom
feed-loop/distro-loopback-coherence

Conversation

@jetm

@jetm jetm commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Problem

The distro feed's loopback rewrite and its --add-host entry read the container arguments of the run, which include anything passed on the command line. Named feeds read sdk.container_args only. For one project the two feeds could disagree. Separately, four feeds tests and two container shutdown tests failed depending on ambient environment variables or on parallel tests sharing process-wide state.

Solution

The composed configuration load records whether sdk.container_args selects host networking, and the distro rewrite and the host entry read that value. Commands that load only the plain configuration (container dev, save, vm) record nothing and keep reading the run's arguments, so they do not regress. Docker still receives every argument unchanged. The six tests now clear the environment they depend on and run serially.

Key changes

  • src/utils/feeds.rs: the recorder and its getter. Under test the recorded value is per thread, so parallel tests do not see each other's value.
  • src/utils/config.rs: the composed load records it.
  • src/utils/container.rs: the rewrite and the host-entry condition read it, with the old reading as the fallback.
  • CHANGELOG.md: says that a --network=host given only on the command line now rewrites a loopback distro URL.

Reviewer notes

A --network=host passed only on the command line now gets the rewritten address and the host entry while docker still runs with host networking. A repository server bound only to 127.0.0.1 is then unreachable that way; the changelog says to put the argument in sdk.container_args. Please check that behavior change and the fallback for the plain-loader commands.

Tests on this layer alone: format and clippy clean, 2408 lib tests pass. The one test skipped by name, overlay_copy_sets_attributes_only_on_paths_it_creates, is an existing setgid check that depends on host GNU tools.

@jetm
jetm added this pull request to stack #388 November 12, 2026 19:24
@jetm
jetm marked this pull request as ready for review November 12, 2026 21:18
@jetm
jetm force-pushed the feed-loop/distro-loopback-coherence branch from 46f834e to 7fd3bad Compare November 12, 2026 22:59
jetm added 4 commits November 12, 2026 17:24
Several tests in feeds and container read process-wide environment variables or share global session state, yet they run in parallel with other tests that mutate the same state. This makes them fail intermittently depending on scheduling, and a leaked AVOCADO_REPO_URL or similar variable from one test can silently change the feed resolution another test expects.

Mark the affected tests as serial and have the feed tests clear the release environment before loading their config, so each starts from a known baseline. Extend the cleanup helper to cover the repo URL, SDK repo URL, insecure and CA variables, which were previously left behind and could leak between tests.

Improve the container test failure message to name the temp directory when the stub tool log is missing. A bare unwrap hid whether the tool was never invoked or the shutdown raced with another test, which made the flakiness hard to diagnose.

Signed-off-by: Javier Tia <javier@peridio.com>
The changelog entry on loopback feed address rewriting did not say how
the distro feed's address is handled. Readers could assume that
container arguments passed on the command line, such as
`--network=host`, also influence the rewrite and the host entry. They
do not, which can lead to confusion when a feed URL is or is not
rewritten unexpectedly.

State that the distro feed's address follows the same detection but
only considers `sdk.container_args` from the configuration. Note that
command-line container arguments still reach the container but are not
consulted for the rewrite or host entry. This documents the actual
behavior so users know where to set arguments that should affect feed
address handling.

Signed-off-by: Javier Tia <javier@peridio.com>
The distro feed decides whether to keep a loopback repo URL or rewrite
it to the host-gateway alias by checking whether the run uses host
networking. That check read the run's own container args, which also
carry arguments layered on from the command line. A `--network=host`
passed only on the command line therefore made the feed keep a loopback
URL and skip the host entry, even though the project config never asked
for host networking. The two views of the same decision could also
disagree between the env URL and the `--add-host` route.

Record the host-networking reading of `sdk.container_args` when the
composed configuration is loaded, and have the container run consult it
for both the URL rewrite and the host entry. The composed load is the
point where those arguments are final, and it is recorded there rather
than in the shared YAML parser so that `Config::load` and unit tests do
not alter a process-wide value. Commands that never run a composed load
record nothing and fall back to the run's own container args, keeping
their previous behavior.

The recorded value is per thread under test, so parallel tests do not
observe each other's recordings.

Signed-off-by: Javier Tia <javier@peridio.com>
…ro URL

The distro feed's loopback decision now follows sdk.container_args alone,
so a --network=host given only on the command line rewrites a loopback
distro URL to the host gateway while docker still runs with host
networking. A repository server bound only to 127.0.0.1 is unreachable in
that case, and nothing in the entry said so, which would show up only as a
dnf failure.

The entry also claimed command-line container arguments are not consulted
for the rewrite or the host entry. That holds for the commands that compose
the configuration; container dev, save and vm load the plain configuration
and fall back to the command-line arguments, so the claim names the split.
@jetm

jetm commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Consolidated into #394, which carries this layer's commits together with the rest of the feed-first stack. Closing so review happens in one place.

@jetm jetm closed this Nov 12, 2026
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.

1 participant