oci: set default PATH when missing or empty - #1113
Open
gcomneno wants to merge 1 commit into
Open
Conversation
gcomneno
force-pushed
the
contrib/issue-729-default-path
branch
2 times, most recently
from
May 24, 2026 15:57
caa0fa1 to
0dd0914
Compare
Contributor
Author
|
Hi! Just gently following up on this one. I rebased the branch onto current
The focused test run passes with Happy to adjust anything else if useful. |
Contributor
Author
|
Friendly ping on this PR. It has been idle for a while, and it should still be ready from my side. Please let me know if you would like me to rebase, refresh the checks, or adjust anything else. Thanks! |
Read PATH via skopeo inspect and set Pebble.DEFAULT_ENV_PATH only when PATH is missing/empty. Add unit tests for PATH present/missing/empty.
gcomneno
force-pushed
the
contrib/issue-729-default-path
branch
from
July 31, 2026 11:33
0dd0914 to
0a6eae1
Compare
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
This PR generalizes the empty-
PATHprotection for OCI images (issue #729).Previously this behavior applied only when
base == "bare". The final imageenvironment is now inspected for every base, after project-defined environment
variables have been applied.
Behavior
PATHis missing or its final value is empty (PATH=), set it toPebble.DEFAULT_ENV_PATH.PATHvalue is non-empty, preserve it.PATHentries exist, the last assignment wins.The implementation reads the final image environment through
skopeo inspectand writes the default only when necessary.
Packaging order
set_default_path()runs afterset_environment(), preventing a project-levelPATH: ""from overwriting the safe default after validation.Tests
Unit coverage includes:
PATHpresent: inspect only, no config write;PATHmissing: inspect and configure the default;PATHempty: inspect and configure the default;PATHentries with last-assignment semantics;PATHvalidation.
Validation performed:
upstream/mainbecausethe local environment lacks the APT package backend;
git diff --checkpassed.Refs #729