Skip to content

Conversation

@rata
Copy link
Member

@rata rata commented Apr 7, 2025

Backport of #4704, fixing moby CI for the upcoming runc release.

rata added 2 commits April 7, 2025 14:17
Before commit 06f1e07 ("libct: speedup process.Env handling") we were
overriding HOME if it was set to "" too[1]. But now we only override it
if it wasn't set at all.

This patch restores the old behavior of overriding it if it was set to
an empty value.

Docker relies on this behaviour since ages[2].

[1]: https://github.com/opencontainers/runc/blob/1c508045727231e7342e258ab30add1478c1f981/libcontainer/init_linux.go#L544-L549
[2]: https://github.com/moby/moby/blob/843e51459f14ebc964d349eba1013dc8a3e9d52e/integration-cli/docker_cli_run_test.go#L822-L843

Signed-off-by: Rodrigo Campos <[email protected]>
(cherry picked from commit 09501d9)
This adds some e2e tests for environment variables set in the
config.json. These were based on tests that failed on docker CI[1][2] after
the refactor on 06f1e07 ("libct: speedup process.Env handling") and
some bugs that I had along the way trying to fix it.

These tests pass with runc 1.2 too.

[1]: https://github.com/moby/moby/blob/843e51459f14ebc964d349eba1013dc8a3e9d52e/integration-cli/docker_cli_run_test.go#L822-L843
[2]: https://github.com/moby/moby/blob/843e51459f14ebc964d349eba1013dc8a3e9d52e/integration-cli/docker_cli_links_test.go#L197-L204

Signed-off-by: Rodrigo Campos <[email protected]>
(cherry picked from commit 19c6515)
@rata rata requested review from AkihiroSuda and kolyshkin April 7, 2025 12:20
@rata rata mentioned this pull request Apr 7, 2025
@rata rata added this to the 1.3.0-rc.2 milestone Apr 7, 2025
@rata rata added the backport/1.3-pr A backport PR to release-1.3 label Apr 7, 2025
@AkihiroSuda AkihiroSuda merged commit 6994570 into opencontainers:release-1.3 Apr 7, 2025
34 checks passed
@rata rata deleted the runc-1.3-env-fixes branch April 8, 2025 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/1.3-pr A backport PR to release-1.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants