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

bindings rmi test: clarify behavior #12606

Merged
merged 1 commit into from
Dec 16, 2021

Conversation

vrothberg
Copy link
Member

@vrothberg vrothberg commented Dec 15, 2021

The libpod/images/remove endpoint is not very REST-ish but, after some
debate, was decided for it to be implemented as is for the following reasons.

First, it allows for batch removing images which improves performance
significantly. Note that Docker does support rmi -a!

Second, it allows for hiding the logic of setting the right exit code to
use from the client and keep all the logic on the server.

Hence, when removing an image that does not exist, the server will
return a 200. The response, however, includes the error message to be
used and the exit code that podman-remote will use.

Fixes: #12441
Signed-off-by: Valentin Rothberg [email protected]

@edsantiago PTAL

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 15, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vrothberg

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 15, 2021
@vrothberg
Copy link
Member Author

@TomSweeneyRedHat
Copy link
Member

Changes look OK to me, but the tests aren't at all happy.

@vrothberg
Copy link
Member Author

Changes look OK to me, but the tests aren't at all happy.

search on registry.access.redhat.com/* is broken. All tests in all PRs are red at the moment :^)

@rhatdan
Copy link
Member

rhatdan commented Dec 16, 2021

LGTM

@vrothberg
Copy link
Member Author

rebased to fix the search flake ✔️

@rhatdan
Copy link
Member

rhatdan commented Dec 16, 2021

/lgtm
/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 16, 2021
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 16, 2021
@edsantiago
Copy link
Member

Unintended consequences

         # # podman rmi quay.io/libpod/testimage@sha256:d48f2feaca74863c342cd9ce11edbe208675975740e7f4dd635b7b345339426a
         # Untagged: quay.io/libpod/testimage@sha256:d48f2feaca74863c342cd9ce11edbe208675975740e7f4dd635b7b345339426a
         # time="2021-12-16T06:55:11-06:00" level=error msg=0
         # #/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
         # #|     FAIL: podman rmi untags, does not remove
         # #| expected: 'Untagged: quay.io/libpod/testimage@sha256:d48f2feaca74863c342cd9ce11edbe208675975740e7f4dd635b7b345339426a'
         # #|   actual: 'Untagged: quay.io/libpod/testimage@sha256:d48f2feaca74863c342cd9ce11edbe208675975740e7f4dd635b7b345339426a'
         # #|         > 'time="2021-12-16T06:55:11-06:00" level=error msg=0'
         # #\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

cmd/podman/images/rm.go Outdated Show resolved Hide resolved
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Dec 16, 2021
The libpod/images/remove endpoint is not very REST-ish but, after some
debate, was decided to be implemented as for the following reasons.

First, it allows for batch removing images which improves performance
significantly.  Note that Docker does support `rmi -a`!

Second, it allows for hiding the logic of setting the right exit code to
use from the client and keep all the logic on the server.

Hence, when removing an image that does not exist, the server will
return a 200. The response, however, includes the error message to be
used *and* the exit code that podman-remote will use.

Fixes: containers#12441
Signed-off-by: Valentin Rothberg <[email protected]>
@vrothberg
Copy link
Member Author

ready to merge

@edsantiago
Copy link
Member

/lgtm
/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 16, 2021
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 16, 2021
@openshift-merge-robot openshift-merge-robot merged commit 273da42 into containers:main Dec 16, 2021
@vrothberg vrothberg deleted the fix-12441 branch December 16, 2021 16:04
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bindings: remove(nonexistent) does not return response code
6 participants