Gitlab storage policy implementation

Hi there,

I am trying to implement a storage policy for packages and containers for my team and would like to know the best way to carry this out.

For the containers I would like to keep a specific version e.g. v2.0.1 and the latest version e.g. v3.1.5, I would also to keep the snapshot for latest release i.e, latest version containing word “SNAPSHOT”

For the packages I would again like to keep a specific version but would also like to keep all releases after v2. I would also then like to keep the snapshot for latest release as well as the snapshot of the previous release.

I have had a look at the Gitlab documentation, for containers I believe it is possible set a cleanup policy that keeps the most recent tag and any tags matching a specific phrase through the UI or API. I’m not sure if it is also possible to keep the snapshot for latest release using this method as well? For the packages it appears the cleanup policy available is limited to reducing the number of assets to keep.

I would like to know if what I am requesting can be done through the UI or API call as this will be the simplest method.

Many Thanks