No way to hide the synced images from the default list

Bug #1975663 reported by Nobuto Murata
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Glance-Simplestreams-Sync Charm
Fix Committed
Undecided
Unassigned

Bug Description

At this point, the charm uploads synced images with visibility=public. Which means everyone using the cloud will see the images like auto-sync/ubuntu-focal-20.04-amd64-server-20220505-disk1.img.

In some cases, cloud admins would like to have only their own images in the default list. If that's the case, it makes sense to upload images with visibility=shared instead of public so we can leverage those images for producing amphora retrofitted ones still.

The binary already has the support so the remaining piece is to pass the option from the charm.

[bin/sstream-mirror-glance]
    parser.add_argument('--visibility', action='store', default='public',
                        choices=('public', 'private', 'community', 'shared'),
                        help='Visibility to apply to stored images.')

Nobuto Murata (nobuto)
description: updated
Revision history for this message
Nobuto Murata (nobuto) wrote :

We need to be mindful if the retrofit still works after changing the visibility. We might need an equivalent to:
GET /v2/images?visibility=community
when trying to find the right image from the retrofit.

Revision history for this message
Nobuto Murata (nobuto) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-glance-simplestreams-sync (master)
Changed in charm-glance-simplestreams-sync:
status: New → In Progress
Revision history for this message
Nobuto Murata (nobuto) wrote :

> This is actually blocked by:
> https://bugs.launchpad.net/simplestreams/+bug/1975903

This has been resolved.

> We need to be mindful if the retrofit still works after changing the visibility. We might need an equivalent to:
> GET /v2/images?visibility=community
> when trying to find the right image from the retrofit.

I've explicitly tested this, and confirmed that def find_source_image in src/lib/charm/openstack/glance_retrofitter.py is able to find visibility=community image with no problem.

Here is an extra debug output I added by hand, and there is an image found with 'visibility': 'community'.

2022-05-27 11:37:27 DEBUG unit.octavia-diskimage-retrofit/0.retrofit-image logger.go:60 image: {'architecture': 'x86_64', 'content_id': 'auto.sync', 'item_name': 'disk1.img', 'os_distro': 'ubuntu', 'os_version': '20.04', 'product_name': 'com.ubuntu.cloud:server:20.04:amd64', 'simplestreams_metadata': '{"aliases": "20.04,default,f,focal,lts,ubuntu", "arch": "amd64", "ftype": "disk1.img", "label": "release", "md5": "2dc7842d298d8163ab9f4fce19459598", "os": "ubuntu", "pubname": "ubuntu-focal-20.04-amd64-server-20220505", "release": "focal", "release_codename": "Focal Fossa", "release_title": "20.04 LTS", "sha256": "9a0f100258640fa68ee13e33f4ea636ee3f82e2b9991381553be65121ce3657b", "size": "595001344", "support_eol": "2025-04-23", "supported": "True", "version": "20.04"}', 'source_content_id': 'com.ubuntu.cloud:released:download', 'version_name': '20220505', 'name': 'auto-sync/ubuntu-focal-20.04-amd64-server-20220505-disk1.img', 'disk_format': 'qcow2', 'container_format': 'bare', 'visibility': 'community', 'size': 595001344, 'virtual_size': None, 'status': 'active', 'checksum': '2dc7842d298d8163ab9f4fce19459598', 'protected': False, 'min_ram': 0, 'min_disk': 0, 'owner': '9eba09b12e9743b384936f90bfac8672', 'os_hidden': False, 'os_hash_algo': 'sha512', 'os_hash_value': '1d05842a3c84e3e896b3e0bf7b0e847f92eb27b604615d9abbd2388e7f29e4312d6b2c5cf15db4ab05134dcff7d3f207663b508017e8989865f4f65babc616e7', 'id': 'b321ce1d-a9d7-4449-8941-f713fb8e031d', 'created_at': '2022-05-27T10:39:27Z', 'updated_at': '2022-05-27T10:39:43Z', 'locations': [{'url': 'rbd://cdd75094-dd95-11ec-b927-95a9929f2375/glance/b321ce1d-a9d7-4449-8941-f713fb8e031d/snap', 'metadata': {'store': 'ceph'}}], 'direct_url': 'rbd://cdd75094-dd95-11ec-b927-95a9929f2375/glance/b321ce1d-a9d7-4449-8941-f713fb8e031d/snap', 'tags': [], 'file': '/v2/images/b321ce1d-a9d7-4449-8941-f713fb8e031d/file', 'schema': '/v2/schemas/image', 'stores': 'ceph'}

Revision history for this message
Nobuto Murata (nobuto) wrote :

Subscribing ~field-medium.

Nobuto Murata (nobuto)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-glance-simplestreams-sync (master)

Reviewed: https://review.opendev.org/c/openstack/charm-glance-simplestreams-sync/+/843603
Committed: https://opendev.org/openstack/charm-glance-simplestreams-sync/commit/f8165cebb89739869845c51734f95833aa497286
Submitter: "Zuul (22348)"
Branch: master

commit f8165cebb89739869845c51734f95833aa497286
Author: Nobuto Murata <email address hidden>
Date: Fri May 27 19:39:09 2022 +0900

    Support --visibility option for simplestreams

    With the new option, Glance images can be uploaded with
    "visibility=shared" for example instead of "public" so those can be
    hidden from usual projects by default.

    Closes-Bug: #1975663
    Change-Id: I1955f3d2a56654c9a683a2b9d36b33c0f0fd63d4

Changed in charm-glance-simplestreams-sync:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-glance-simplestreams-sync (stable/yoga)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-glance-simplestreams-sync (stable/xena)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-glance-simplestreams-sync (stable/victoria)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-glance-simplestreams-sync (stable/wallaby)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-glance-simplestreams-sync (stable/ussuri)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-glance-simplestreams-sync (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/charm-glance-simplestreams-sync/+/843811
Committed: https://opendev.org/openstack/charm-glance-simplestreams-sync/commit/bb7c601160902dd9bb3cb6cd0121950b7e9b909a
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit bb7c601160902dd9bb3cb6cd0121950b7e9b909a
Author: Nobuto Murata <email address hidden>
Date: Fri May 27 19:39:09 2022 +0900

    Support --visibility option for simplestreams

    With the new option, Glance images can be uploaded with
    "visibility=shared" for example instead of "public" so those can be
    hidden from usual projects by default.

    Closes-Bug: #1975663
    Change-Id: I1955f3d2a56654c9a683a2b9d36b33c0f0fd63d4
    (cherry picked from commit f8165cebb89739869845c51734f95833aa497286)

tags: added: in-stable-yoga
Revision history for this message
Nikita Koltsov (nkoltsov) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-glance-simplestreams-sync (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/charm-glance-simplestreams-sync/+/845200
Committed: https://opendev.org/openstack/charm-glance-simplestreams-sync/commit/ababb6f4c024d422e9a02c2e854d4ccfeb83518f
Submitter: "Zuul (22348)"
Branch: stable/xena

commit ababb6f4c024d422e9a02c2e854d4ccfeb83518f
Author: Nobuto Murata <email address hidden>
Date: Fri May 27 19:39:09 2022 +0900

    Support --visibility option for simplestreams

    With the new option, Glance images can be uploaded with
    "visibility=shared" for example instead of "public" so those can be
    hidden from usual projects by default.

    Closes-Bug: #1975663
    Change-Id: I1955f3d2a56654c9a683a2b9d36b33c0f0fd63d4
    (cherry picked from commit f8165cebb89739869845c51734f95833aa497286)

tags: added: in-stable-xena
tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-glance-simplestreams-sync (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/charm-glance-simplestreams-sync/+/845202
Committed: https://opendev.org/openstack/charm-glance-simplestreams-sync/commit/86714de2b683de0d9a150b13f9f2875d4ab36188
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 86714de2b683de0d9a150b13f9f2875d4ab36188
Author: Nobuto Murata <email address hidden>
Date: Fri May 27 19:39:09 2022 +0900

    Support --visibility option for simplestreams

    With the new option, Glance images can be uploaded with
    "visibility=shared" for example instead of "public" so those can be
    hidden from usual projects by default.

    Closes-Bug: #1975663
    Change-Id: I1955f3d2a56654c9a683a2b9d36b33c0f0fd63d4
    (cherry picked from commit f8165cebb89739869845c51734f95833aa497286)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-glance-simplestreams-sync (stable/victoria)

Reviewed: https://review.opendev.org/c/openstack/charm-glance-simplestreams-sync/+/845201
Committed: https://opendev.org/openstack/charm-glance-simplestreams-sync/commit/a29d9d71a6e4717a6f676d5266764b8f18faf986
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit a29d9d71a6e4717a6f676d5266764b8f18faf986
Author: Nobuto Murata <email address hidden>
Date: Fri May 27 19:39:09 2022 +0900

    Support --visibility option for simplestreams

    With the new option, Glance images can be uploaded with
    "visibility=shared" for example instead of "public" so those can be
    hidden from usual projects by default.

    Closes-Bug: #1975663
    Change-Id: I1955f3d2a56654c9a683a2b9d36b33c0f0fd63d4
    (cherry picked from commit f8165cebb89739869845c51734f95833aa497286)

tags: added: in-stable-victoria
tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-glance-simplestreams-sync (stable/ussuri)

Reviewed: https://review.opendev.org/c/openstack/charm-glance-simplestreams-sync/+/845203
Committed: https://opendev.org/openstack/charm-glance-simplestreams-sync/commit/ca749ace42a8ae38aa6d3137a9de3d6a8e589efc
Submitter: "Zuul (22348)"
Branch: stable/ussuri

commit ca749ace42a8ae38aa6d3137a9de3d6a8e589efc
Author: Nobuto Murata <email address hidden>
Date: Fri May 27 19:39:09 2022 +0900

    Support --visibility option for simplestreams

    With the new option, Glance images can be uploaded with
    "visibility=shared" for example instead of "public" so those can be
    hidden from usual projects by default.

    Closes-Bug: #1975663
    Change-Id: I1955f3d2a56654c9a683a2b9d36b33c0f0fd63d4
    (cherry picked from commit f8165cebb89739869845c51734f95833aa497286)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.