Skip to content

Instantly share code, notes, and snippets.

@nlowe
Created December 20, 2018 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nlowe/f23a1dbb2e277f9655f266261ee5035e to your computer and use it in GitHub Desktop.
Save nlowe/f23a1dbb2e277f9655f266261ee5035e to your computer and use it in GitHub Desktop.
New Feature: Tag Retention Policies

This is a meta issue tracking the implementation of Tag Retention Policies

Summary

Not many people have the luxury of unlimited storage. For images and tags that are effectively ephemeral (like those built and tagged for use only by an intermediate process in a CI pipeline) it does not make sense to keep these tags around for an extended period of time, consuming precious resources. Other tags, like those correlating to released or deployed software may need to be kept for an extended period of time or even forever for various legal or compliance reasons. While this is possible today via Harbor's API, Harbor Administrators could greatly benefit from having this functionality built-in to harbor itself.

Progress

As this is a large feature and I can really only work on it in my free time, I'm splitting it up into multiple smaller issues. If you see something you're interested in working on feel free to contribute!

I envision this being implemented in roughly this order:

  • Groundwork
    • Common types / interfaces / boilerplate
    • Filter chain builder
  • Filter Implementations
    • Keep Everything
    • Delete Everything
    • Always Keep tag x
    • Always Delete tag x
    • Keep if downloaded at least n days ago
    • Keep most recent n tags
    • Delete tags older than n days
  • API
    • CRUD for policies
    • Get logs for execution
    • Trigger tag processing
  • Misc
    • Run tag processing on a schedule
    • UI Proposal drafted

The UI proposal draft can start at any stage. The actual scheduling / execution of tag processing will be disabled until the feature is fully implemented. This way we can work on this in small, reviewable chunks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment