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

Deletion Policy with label filtering #16874

Open
lavih opened this issue May 18, 2022 · 3 comments
Open

Deletion Policy with label filtering #16874

lavih opened this issue May 18, 2022 · 3 comments
Assignees
Labels
kind/requirement New feature or idea on top of harbor

Comments

@lavih
Copy link

lavih commented May 18, 2022

Is your feature request related to a problem? Please describe.
From my understanding from the docs and our personal day to day usage when we choose to apply a new TAG_RETENTION deletion rule we can smartly filter repos and tags using REGEX or avoid deleting some tags using TAG_IMMUTABILITY also with REGEX.
my issue is the need to assign specific tag to images I want to keep. for example base images need the tag "base" for the tag regex to
avoid deleting them, or add a "static" tag for static images which dont need to be built and updated every night like redis and postgresql for example - which will get deleted after the COUNT_NUMBER_OF_DAYS we use on the deletion policy passes

Describe the solution you'd like
If possible I suggest to add the ability to filter using labels as well. For example label the whole artifact with "KEEP" label for static images like redis or postgresql for example.

Describe the main design/architecture of your solution
maybe using LABEL_IMMUTABILITY screen?
or add AND / OR logic in the GUI ?

Thanks!
Lavih

@wy65701436 wy65701436 added the kind/requirement New feature or idea on top of harbor label May 23, 2022
@zyyw
Copy link
Contributor

zyyw commented May 23, 2022

@lavih If I understand your description correctly, the current TAG_RETENTION + TAG_IMMUTABILITY are sufficient for you to achieve your use case, and in this issue you are just proposing an alternative method, which is TAG_RETENTION + LABEL to achieve the same use case.

Could you please justify why you prefer TAG_RETENTION + LABEL feature? Thanks

@lavih
Copy link
Author

lavih commented May 23, 2022

hey @zyyw ,
my personal main reasons for suggesting this feature are:

  1. we save hundreds of static images for airgaped installs, for example: rancher , istio , monitring tools , CI tools etc..
    they are in different repos, so filtering using tag regex would be very hard since every image end with different version for example: "1.8.0"

  2. requires to force or educate all our developers to tag and push manually or via CI with specific tag

  3. images like redis:6.2 or postgresql:6 which are scattered across repos would require re-tag and push and maintaing all new images with specific tag that matches the REGEX.

using the label feature I will be able to programatically label specific static artifacts like redis:6.2 or postgresql:6 with a harbor label for example: "KEEP" and set the retention to save keep labeled artifacts - which will allow me to keep the origin tag or repo. If you think this approach is counter-productive or very rare use-case I will be more than happy to learn how it can be done more efficiently

@github-actions
Copy link

github-actions bot commented Jul 5, 2022

This issue is being marked stale due to a period of inactivity. If this issue is still relevant, please comment or remove the stale label. Otherwise, this issue will close in 30 days.

@github-actions github-actions bot added the Stale label Jul 5, 2022
@stonezdj stonezdj removed the Stale label Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/requirement New feature or idea on top of harbor
Projects
None yet
Development

No branches or pull requests

5 participants