fix: Support loading tarballs with podman via oci_load - #906
Matthew-Benson wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2389b81f19
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Some versions of Podman appear to handle loading a tarball differently depending upon with the input is /dev/stdin or not. In particular: ``` podman load --input <(cat foo.tar) ``` raises an error, while: ``` cat foo.tar | podman load ``` works without error. (Podman loads from stdin if no --input is specified.) fixes bazel-contrib#711
2389b81 to
12f0d41
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 12f0d41364
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| "$TAR" --cd "$RUNFILES_DIR" --create --no-xattr --no-mac-metadata @- <<< "$mtree_contents" | ||
| ) | ||
| wait $! | ||
| if [ "$CONTAINER_CLI" = "podman" ]; then |
There was a problem hiding this comment.
Handle Podman supplied through the loader attribute
When loader is set to a Podman executable, CONTAINER_CLI contains its resolved runfiles path rather than the literal string podman, so this condition is false. The script then uses the same load --input <(...) invocation that this change is intended to avoid, meaning affected Podman versions still fail for hermetically supplied loaders; detect Podman without requiring an exact full-path match or use the stdin pipeline for this case too.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
That's valid criticism. We can use if [ "$(basename "$CONTAINER_CLI")" = "podman" ]; then, but that still depends on the user provided loader having a basename of "podman" and not something else like "podman_bin".
Some versions of Podman appear to handle loading a tarball differently depending upon with the input is /dev/stdin or not. In particular:
raises an error, while:
works without error. (Podman loads from stdin if no --input is specified.)
fixes #711