Skip to content

fix: Support loading tarballs with podman via oci_load - #906

Open
Matthew-Benson wants to merge 1 commit into
bazel-contrib:mainfrom
Matthew-Benson:oci_load-podman-bug-fix
Open

Matthew-Benson wants to merge 1 commit into
bazel-contrib:mainfrom
Matthew-Benson:oci_load-podman-bug-fix

Conversation

@Matthew-Benson

Copy link
Copy Markdown

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 #711

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread oci/private/load.sh.tpl Outdated
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
@Matthew-Benson
Matthew-Benson force-pushed the oci_load-podman-bug-fix branch from 2389b81 to 12f0d41 Compare August 27, 2026 00:56
@Matthew-Benson
Matthew-Benson marked this pull request as ready for review August 27, 2026 00:56

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread oci/private/load.sh.tpl
"$TAR" --cd "$RUNFILES_DIR" --create --no-xattr --no-mac-metadata @- <<< "$mtree_contents"
)
wait $!
if [ "$CONTAINER_CLI" = "podman" ]; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".

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.

oci_load incompatible with older version of Podman

1 participant