Public bug reported:

The GlanceMirror class has a hard-coded filter for items to be
downloaded. 

Anyone using it directly or via the script in
tools/sstream-mirror-glance to load images into an openstack cloud
will end up with a large number of images, at least one for each of
the available release series, and only x86_64 or amd64.

It is likely that users will want to be able to limit the images they
download to just one release, and may want to be able to download
images for other architectures, such as arm*.

The uploaded package simply exposes the existing filter mechanism as a
config option, using the previous hardcoded values as defaults.

This config option is used (currently it is just ignored by the
published simplestreams code) in an charm that is released on the
charm store for trusty, 'glance-simplestreams-sync'. Users of
OpenStack on Trusty are likely to want the option to control image
downloads via that charm.

[Test Case]

In an openstack cloud, with proper openstack env vars (OS_USERNAME,
OS_PASSWORD, OS_REGION etc), run the sstream-mirror-glance tool to
download images locally:

from the source tree top directory,

PYTHONPATH=. tools/sstream-mirror-glance --max=1 -v -v -v --output-dir \
images/ --cloud-name test_cloud --content-id test_content \
--keyring /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg \
http://cloud-images.ubuntu.com/releases/ streams/v1/index.json

verify that it downloads many images. This may take a while.  If you
like, you can just check that it will download an image for an old
series like raring or quantal.

Clean up after it by removing the images/ directory.

Then with the update applied, from the source tree top dir:

PYTHONPATH=. tools/sstream-mirror-glance --max=1 -v -v -v --output-dir \
images/ --cloud-name test_cloud --content-id test_content \
--keyring /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg \
--item-filter="release=trusty" --item-filter="arch=arm64" \
http://cloud-images.ubuntu.com/releases/ streams/v1/index.json

and verify that it downloads only one matching image, trusty on arm64.

[Regression Potential]

This has very limited regression potential, because anyone relying on
the existing behavior will still get it because the previous behavior
is retained via defaults.

** Affects: simplestreams
     Importance: Undecided
         Status: Fix Committed

** Affects: simplestreams (Ubuntu)
     Importance: High
         Status: Confirmed


** Tags: cloud-installer

** Also affects: simplestreams
   Importance: Undecided
       Status: New

** Changed in: simplestreams
       Status: New => Fix Committed

** Branch linked: lp:~mikemc/simplestreams/add-filters-glance

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to simplestreams in Ubuntu.
https://bugs.launchpad.net/bugs/1339842

Title:
  GlanceMirror item filters are hardcoded

To manage notifications about this bug go to:
https://bugs.launchpad.net/simplestreams/+bug/1339842/+subscriptions

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to