Add an option to replicator to select which images to compare/copy
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Glance |
Wishlist
|
Unassigned |
Bug Description
It would be nice to add some sort of filter to images considered by glance-replicator.
Two types of a filters would be nice :
* a list of ids
* a list of names
(and maybe some sort of regexp on the names, for example --filter "ubuntu-*")
A quick look at the code makes me think this can easily be added in the def get_images just before the yield.
For interfacing I would add :
--filter-by-name 'item1,item2,item3"
--filter-by-name 'ubuntu-*'
--filter-by-id 'id1,id2,id3'
Am willing to contribute a patch if feature request is adopted (we are going to implement it anyway).
Changed in glance: | |
importance: | Undecided → Wishlist |
status: | New → Incomplete |
Ian Cordasco (icordasc) wrote : | #1 |
No problem about not going for the regexp, I understand why you are reluctant.
One could easily script using bash to answer that scenario (for i in `glance image-list | grep ubuntu-`; etc.)
Marc Abramowitz (msabramo) wrote : | #3 |
I was thinking of implementing something to allow only syncing images that match a regex. For my use case, I want to make sure that images that start with "Koala" are synced. So something like --filter-
I marked this as "Wishlist" because it's an enhancement request and Incomplete because we haven't yet decided whether to accept it.
Personally, it seems feasible to support --filter-by-id and --filter-by-name's first case. Personally I'm not a fan of your `--filter-by-name 'ubuntu-*'` example because I can't think of another openstack cli that supports anything like that. I also don't like the idea of supporting arbitrary regular expressions provided by users. I'm going to add this to the meeting agenda for next Thursday's meeting though to discuss it.
Thanks for suggesting it!