Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildah manifest add localimage should work #2955

Merged
merged 2 commits into from
Feb 5, 2021
Merged

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Feb 2, 2021

Currently if you attempt to build create a manifest
and add a local image, the command blows up.

The current code always looks for a remote image.
This PR fixes the code to use the local image if it
exists.

Signed-off-by: Daniel J Walsh [email protected]

What type of PR is this?

/kind api-change
/kind bug
/kind cleanup
/kind deprecation
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake
/kind other

What this PR does / why we need it:

How to verify it

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?


@nalind
Copy link
Member

nalind commented Feb 2, 2021

Does this reintroduce the problem that #2824 was attempting to fix?

return err
var storeErr error
// check if the local image exists
if ref, _, storeErr = util.FindImage(store, "", systemContext, imageSpec); storeErr != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

That check never happens since the imagespec is parsed correctly as a remote image, so we always fail if we use a local image that does not exists at a registry.

Copy link
Member Author

Choose a reason for hiding this comment

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

The remote image is never checked until this call.

Copy link
Contributor

Choose a reason for hiding this comment

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

That check never happens since the imagespec is parsed correctly as a remote image, so we always fail if we use a local image that does not exists at a registry.

LGTM. We could also delete check L296~L297 since they can't be reached.

Copy link
Member Author

Choose a reason for hiding this comment

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

No I can reach there by attempting

./bin/buildah manifest add myimage sha256:c1876ff0a66a49ae90dbe6ac1d8c413107fec317987c4e2059cf72b430f5a023

Which is also valid.

@rhatdan
Copy link
Member Author

rhatdan commented Feb 2, 2021

@nalind I don't see how, since it will first check at the remote site. It will only check local storage if it does not exists on the remote site.

Copy link
Contributor

@QiWang19 QiWang19 left a comment

Choose a reason for hiding this comment

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

LGTM

@rhatdan rhatdan force-pushed the list branch 2 times, most recently from 3868921 to a70d2f4 Compare February 5, 2021 15:29
Currently if you attempt to build create a manifest
and add a local image, the command blows up.

The current code always looks for a remote image.
This PR fixes the code to use the local image if it
exists.

Signed-off-by: Daniel J Walsh <[email protected]>
Buildah bud --manifest XYZ was not working.

The manifest was never created. This PR Finishes
the plumbing and allows users to create a manifest
while building an image in one single command.

Signed-off-by: Daniel J Walsh <[email protected]>
run echo hello
_EOF

run_buildah bud -q --manifest=testlist -t arch-test --signature-policy ${TESTSDIR}/policy.json ${mytmpdir} <<< input
Copy link
Member

Choose a reason for hiding this comment

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

is the <<< input at the end here correct? I'm not seeing a --stdin option.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes this came from other tests. Not sure what it does.

Copy link
Member

Choose a reason for hiding this comment

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

It must just be passing input in as input into the build command and then ignoring it.
Weird, but OK and the tests are happy.

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: rhatdan

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

The pull request process is described 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

@rhatdan rhatdan added the lgtm label Feb 5, 2021
@rhatdan rhatdan merged commit 88bc27d into containers:master Feb 5, 2021
@TomSweeneyRedHat
Copy link
Member

LGTM

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants