Skip to content

Conversation

aeijdenberg
Copy link
Contributor

What type of PR is this?

/kind bug

What this PR does / why we need it:

This allows buildah build -f <(echo 'FROM busybox') --tag=oci-archive:out.tar to succeed without error.

How to verify it

bats test added.

Which issue(s) this PR fixes:

FIxes #6280

Special notes for your reviewer:

It's not 100% clear to me this is the right solution to fix, but I noticed that other code which adds tags to images, such as

// Add additional tags and print image names recorded in storage
if dest, err := b.resolveNameToImageRef(b.output); err == nil {
switch dest.Transport().Name() {
case storageTransport.Transport.Name():
does the same check before trying to tag, so this duplicates that check and adds it to this other code path.

Does this PR introduce a user-facing change?

None

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 12, 2025
Copy link
Contributor

openshift-ci bot commented Jul 12, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: aeijdenberg
Once this PR has been reviewed and has the lgtm label, please assign nalind for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@nalind
Copy link
Member

nalind commented Jul 14, 2025

Thanks! Though this bypasses the cp.Image() call further down, which is what would write the output image, and I think we want to keep writing the image.

@aeijdenberg
Copy link
Contributor Author

Thanks! Though this bypasses the cp.Image() call further down, which is what would write the output image, and I think we want to keep writing the image.

You're right, and we certainly do want to keep writing the image out. I'm pretty sure I had that working in an earlier iteration - I'll see what I missed, fix up and add more tests.

Thanks for the pickup...

Previously using outputing to a tar would fail with a simple `FROM xxx`
image.

This now will complete the copy (including passing through any specified
timestamp) and stop before trying to tag a non-registry stored result.

Signed-off-by: Adam Eijdenberg <[email protected]>
@aeijdenberg
Copy link
Contributor Author

Rebased and included the additional fix originally submitted in #6298

@aeijdenberg aeijdenberg changed the title fix: don't try to tag oci-archive destinations fix(build): make --tag oci-archive:xxx.tar work with simple images Jul 24, 2025
Copy link

A friendly reminder that this PR had no activity for 30 days.

@dustymabe
Copy link

I think this helped me get around an error I was seeing. @nalind - mind another review?

@github-actions github-actions bot removed the stale-pr label Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

build to oci-archive, with single FROM statement fails
3 participants