Skip to content

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Sep 24, 2025

This commit implements the --ignore functionality for the artifact rm command, allowing users to ignore errors when specified artifacts do not exist.

Changes made:

  • Add Ignore field to ArtifactRemoveOptions entity types
  • Add --ignore CLI flag (-i short form) to artifact rm command
  • Implement ignore logic in ABI backend to continue processing on errors
  • Update API handlers and tunnel implementation for podman-remote support
  • Add comprehensive documentation and examples to man page
  • Add e2e and system BATS tests for --ignore functionality
  • Clean up whitespace in BATS test files

The --ignore option follows the same pattern as other podman ignore options like 'podman image rm --ignore' and 'podman pod rm --ignore'. It allows scripts to continue execution when trying to remove artifacts that may not exist, preventing race conditions in cleanup scenarios.

Usage examples:
podman artifact rm --ignore nonexistent-artifact
podman artifact rm --ignore existing-artifact nonexistent-artifact

Fixes: #27084

Does this PR introduce a user-facing change?

podman artifact rm --ignore option added.

Copy link
Contributor

openshift-ci bot commented Sep 24, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rhatdan
Once this PR has been reviewed and has the lgtm label, please assign tomsweeneyredhat 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

@github-actions github-actions bot added the kind/api-change Change to remote API; merits scrutiny label Sep 24, 2025
@rhatdan
Copy link
Member Author

rhatdan commented Sep 24, 2025

This PR was also generated with Cursor, this time by just telling it to fix the #27084 issue.

This commit implements the --ignore functionality for the artifact rm command,
allowing users to ignore errors when specified artifacts do not exist.

Changes made:
- Add Ignore field to ArtifactRemoveOptions entity types
- Add --ignore CLI flag (-i short form) to artifact rm command
- Implement ignore logic in ABI backend to continue processing on errors
- Update API handlers and tunnel implementation for podman-remote support
- Add comprehensive documentation and examples to man page
- Add e2e and system BATS tests for --ignore functionality
- Clean up whitespace in BATS test files

The --ignore option follows the same pattern as other podman ignore options
like 'podman image rm --ignore' and 'podman pod rm --ignore'. It allows
scripts to continue execution when trying to remove artifacts that may
not exist, preventing race conditions in cleanup scenarios.

Usage examples:
  podman artifact rm --ignore nonexistent-artifact
  podman artifact rm --ignore existing-artifact nonexistent-artifact

Fixes: containers#27084
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Print usage statement.

#### **--ignore**, **-i**
Copy link
Member

Choose a reason for hiding this comment

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

Should use @@option ignore here

@mheon
Copy link
Member

mheon commented Sep 24, 2025

You were beaten by #27142


Ignore errors when removing non-existent artifacts.
```
$ podman artifact rm --ignore nonexistent-artifact existing-artifact
Copy link
Member

Choose a reason for hiding this comment

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

i would prefer the use of fully qualified artifact names here.

@baude
Copy link
Member

baude commented Sep 24, 2025

duplicate of #27142 as @mheon mentioned

@rhatdan
Copy link
Member Author

rhatdan commented Sep 24, 2025

The beaten part was fine, I was really experimenting with Cursor here. And in my opinion it worked pretty well.

Closing.

@rhatdan rhatdan closed this Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/api-change Change to remote API; merits scrutiny release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add --ignore option to podman artifact rm.
3 participants