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
This commit is contained in:
parent
c749054e03
commit
f8165cebb8
|
@ -49,6 +49,12 @@ options:
|
||||||
type: string
|
type: string
|
||||||
default: "auto-sync/"
|
default: "auto-sync/"
|
||||||
description: "This is prefixed to the object name when uploading to glance."
|
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:
|
custom_properties:
|
||||||
type: string
|
type: string
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -299,6 +299,14 @@ def do_sync(ksc, charm_conf):
|
||||||
custom_property
|
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 += [
|
sync_command += [
|
||||||
mirror_info['url'],
|
mirror_info['url'],
|
||||||
]
|
]
|
||||||
|
|
|
@ -173,6 +173,7 @@ class MirrorsConfigServiceContext(OSContextGenerator):
|
||||||
return dict(mirror_list=config['mirror_list'],
|
return dict(mirror_list=config['mirror_list'],
|
||||||
modify_hook_scripts=', '.join(modify_hook_scripts),
|
modify_hook_scripts=', '.join(modify_hook_scripts),
|
||||||
name_prefix=config['name_prefix'],
|
name_prefix=config['name_prefix'],
|
||||||
|
visibility=config['visibility'],
|
||||||
content_id_template=config['content_id_template'],
|
content_id_template=config['content_id_template'],
|
||||||
use_swift=config['use_swift'],
|
use_swift=config['use_swift'],
|
||||||
ignore_proxy_for_object_store=config[
|
ignore_proxy_for_object_store=config[
|
||||||
|
|
|
@ -2,6 +2,7 @@ mirror_list: {{ mirror_list }}
|
||||||
user_agent: {{ user_agent }}
|
user_agent: {{ user_agent }}
|
||||||
modify_hook_scripts: {{ modify_hook_scripts }}
|
modify_hook_scripts: {{ modify_hook_scripts }}
|
||||||
name_prefix: {{ name_prefix }}
|
name_prefix: {{ name_prefix }}
|
||||||
|
visibility: {{ visibility }}
|
||||||
use_swift: {{ use_swift }}
|
use_swift: {{ use_swift }}
|
||||||
ignore_proxy_for_object_store: {{ ignore_proxy_for_object_store }}
|
ignore_proxy_for_object_store: {{ ignore_proxy_for_object_store }}
|
||||||
region: {{ region }}
|
region: {{ region }}
|
||||||
|
|
Loading…
Reference in New Issue