Skip to content
This repository has been archived by the owner on Jun 11, 2019. It is now read-only.

Allow wildcards in exclude list #8

Closed
sshipway opened this issue Dec 21, 2015 · 4 comments
Closed

Allow wildcards in exclude list #8

sshipway opened this issue Dec 21, 2015 · 4 comments

Comments

@sshipway
Copy link
Contributor

It would be very helpful if KEEP_IMAGES could take wildcards, or if specifying a container without a tag implied ALL tags. IE:

steve/foo : Keep steve/foo:latest, steve/foo:v1, steve/foo:v2 etc (same as steve/foo:* )
steve/* : Keep steve/foo:latest, steve/bar:v1, etc (same as steve/: )
steve/foo:latest : Only keep steve/foo:latest
steve/*:latest : Keep latest versions of all steve containers; steve/foo:latest, steve/bar:latest, etc

Doing this would allow us to clean up only unused container that are not in-house created, or all versions of one particular container.

@mikljohansson
Copy link
Contributor

Sounds like a great idea! Even better perhaps with regex support which can do OR and allow more flexibility. Christmas present pull requests are most welcome, and grep can support regex I'd guess :) We've been wanting this as well so might implement it next year otherwise.

Happy holidays!

@mikljohansson
Copy link
Contributor

The new KEEP_CONTAINERS parameter option uses a list of regexes to specify images of containers to keep. Perhaps the KEEP_IMAGES parameter could be converted to a list of regexes as well. This could be backwards compatible and could utilize the same =~ bash regex operator as KEEP_CONTAINERS now use.

@sshipway Any chance you could help out with a pull request that implements =~ comparisons for the KEEP_IMAGES parameter?

@sshipway
Copy link
Contributor Author

I'm a bit pressured at the moment in getting our production cluster up and running :(
The new KEEP_CONTAINERS is interesting, though we already have a scheduler (Rancher) that handles that part of things. Being able to usea regexp list for KEEP_IMAGES would be good.
I did have a quick look at the code previously, but it appears that the image cleanup is not so easy to regexp-ize as I'd originally hoped. I'll take a look again once this rush is out of the way and I have time to devote to it.

@sshipway
Copy link
Contributor Author

This is implemented by #20

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants