Merge lp://qastaging/~smoser/simplestreams/trunk.1686086 into lp://qastaging/simplestreams
Status: | Merged |
---|---|
Merged at revision: | 455 |
Proposed branch: | lp://qastaging/~smoser/simplestreams/trunk.1686086 |
Merge into: | lp://qastaging/simplestreams |
Diff against target: |
193 lines (+86/-16) 2 files modified
simplestreams/mirrors/glance.py (+65/-13) tests/unittests/test_glancemirror.py (+21/-3) |
To merge this branch: | bzr merge lp://qastaging/~smoser/simplestreams/trunk.1686086 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Server Team CI bot | continuous-integration | Approve | |
David Ames (community) | Needs Fixing | ||
simplestreams-dev | Pending | ||
Review via email:
|
Commit message
OpenStack: support uploading squash images for nova-lxd.
Previously, populating a nova-lxd cloud was possible by using
root.tar.gz. A filter like:
ftype~
would cause simplestreams to upload an image with 'disk-format' of
root-tar.
However, Ubuntu 17.04 and newer do not have root.tar.gz or root.tar.xz
images available. Currently here is what is available:
14.04: root.tar.gz root.tar.xz
16.04: root.tar.gz root.tar.xz squashfs
17.10: squashfs
If we simply expected the user to change their filter to include
root.
Then they would get two lxd images imported for each version.
The change here is to not do anything for an item insert, but instead
insert when the version's insert is called. Then, all the information
about what images there are is available, and it can "pick"
one or the other. Currently preference is given to the .tar.xz format.
The end result is that now users can specify an ftype filter of:
ftype~
and the right thing will be done.
Also here is simple knowledge that the squashfs type should be
uploaded to glance with a 'disk_format' of 'squashfs'.
Interested in thoughts from anyone who sees this.
I'm aware that it'd be nice to have a full "sync" call on this in unit tests.
The other question is really just if this is the right thing to do... the logic is just that if the input stream has both a root-tar (root-tar.gz or root-tar.xz) that was not filtered out, *and* has a squashfs image, then we ignore the squashfs image. Thats just to avoid getting both uploaded, which would be kind of confusing.
Another option woudl be to just upload whatever the filter let in, and expect users to change to filtering out the root-tar.