-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Feat artifact rm ignore #27142
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
base: main
Are you sure you want to change the base?
Feat artifact rm ignore #27142
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: nothiaki 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 |
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
1 similar comment
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've checked your changes and I think the --ignore
flag should also be available for remote clients.
Also, please link the correct issue number.
Alright, I will do it! |
0de706e
to
f0724e4
Compare
@Honny1 I think the PR is done, but the CI is failing. |
Deleted: 72875f8f6f78d5b8ba98b2dd2c0a6f395fde8f05ff63a1df580d7a88f5afa97b | ||
``` | ||
|
||
Remove artifacts ignoring the errors if the artifact does not exists. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/exists/exist
This looks good to me. I wonder if we should have a logrus.debug for when the artifact does not exist? it might help down the line, but I dont feel strongly about it. You have one grammatical/spelling mistake to fix at least. And thanks for your submission. |
I fixed the grammatical mistake! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM. Just one small request: could you please squash all your commits into one?
if err != nil { | ||
if errors.Is(err, libartifact_types.ErrArtifactNotExist) { | ||
if removeOptions.Ignore { | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to write a 200 header before you return here
pkg/domain/infra/abi/artifact.go
Outdated
artifactDigest, err := artStore.Remove(ctx, namesOrDigest) | ||
if err != nil { | ||
if opts.Ignore { | ||
logrus.Debugf("Artifact does not exist, ignoring error (--ignore): %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe include namesOrDigest in the error somewhere so it's very clear what artifact wasn't there
bdaba0f
to
f1464ef
Compare
|
||
Remove artifacts ignoring the errors if the artifact does not exist. | ||
``` | ||
$ podman artifact rm -i NonExistsId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would prefer either a full or partial uuid OR a fully qualified name here so we dont confuse users about artifacts not honoring shortnames.
Signed-off-by: Celso Henrique Souza Silva <celsohenrique367@gmail.com>
f1464ef
to
208b9d3
Compare
LGTM |
Does this PR introduce a user-facing change?
Yes, --ignore flag.
Closes #27084