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

Add support for deleting parent paths of matches #1

Merged
merged 9 commits into from
Sep 18, 2023
Merged

Conversation

praqma-thi
Copy link
Contributor

Adds support for templates to specify a deleteParent property, which would allow users to specify they want the parent paths of FileSpec matches to be deleted, rather than the matches themselves.

This will allow users to delete artifact directories if they contain an artifact matching their conditions.

This could also be used to delete Docker images based on conditions of their manifest.json, for example.

As for the implementation, if a policy has deleteParent set to true, rather than expanding the template directly into a resulting FileSpec, we generate the FileSpec, search for matches, and generate a FileSpec that matches the parent paths of the result.

@praqma-thi praqma-thi merged commit e510bf7 into main Sep 18, 2023
2 checks passed
@praqma-thi praqma-thi deleted the delete-parent branch September 18, 2023 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant