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 f8165cebb8
)
This commit is contained in:
parent
ad8961a599
commit
bb7c601160
|
@ -49,6 +49,12 @@ options:
|
|||
type: string
|
||||
default: "auto-sync/"
|
||||
description: "This is prefixed to the object name when uploading to glance."
|
||||
visibility:
|
||||
type: string
|
||||
default: "public"
|
||||
description: >
|
||||
Visibility to apply to stored images. Possible values are
|
||||
'public', 'private', 'community', and 'shared'.
|
||||
custom_properties:
|
||||
type: string
|
||||
default:
|
||||
|
|
|
@ -299,6 +299,14 @@ def do_sync(ksc, charm_conf):
|
|||
custom_property
|
||||
]
|
||||
|
||||
# --visibility is relatively new so use it only when the
|
||||
# default value is modified for backward compatibility
|
||||
if charm_conf['visibility'] != "public":
|
||||
sync_command += [
|
||||
"--visibility",
|
||||
charm_conf['visibility'],
|
||||
]
|
||||
|
||||
sync_command += [
|
||||
mirror_info['url'],
|
||||
]
|
||||
|
|
|
@ -173,6 +173,7 @@ class MirrorsConfigServiceContext(OSContextGenerator):
|
|||
return dict(mirror_list=config['mirror_list'],
|
||||
modify_hook_scripts=', '.join(modify_hook_scripts),
|
||||
name_prefix=config['name_prefix'],
|
||||
visibility=config['visibility'],
|
||||
content_id_template=config['content_id_template'],
|
||||
use_swift=config['use_swift'],
|
||||
ignore_proxy_for_object_store=config[
|
||||
|
|
|
@ -2,6 +2,7 @@ mirror_list: {{ mirror_list }}
|
|||
user_agent: {{ user_agent }}
|
||||
modify_hook_scripts: {{ modify_hook_scripts }}
|
||||
name_prefix: {{ name_prefix }}
|
||||
visibility: {{ visibility }}
|
||||
use_swift: {{ use_swift }}
|
||||
ignore_proxy_for_object_store: {{ ignore_proxy_for_object_store }}
|
||||
region: {{ region }}
|
||||
|
|
Loading…
Reference in New Issue