aboutsummaryrefslogtreecommitdiff
path: root/kolla/common
diff options
context:
space:
mode:
authorMark Goddard <mark@stackhpc.com>2022-03-14 13:57:12 +0000
committerMark Goddard <mark@stackhpc.com>2022-03-16 17:07:01 +0000
commitc9f93c30c1fa24e4949b2c34341cbbedf00421e9 (patch)
tree80f60da3c0f19c01319777dc9f22ed48091db640 /kolla/common
parent5bb6489922aab2b431be8f121465eb7f3a49b5ae (diff)
downloadkolla-c9f93c30c1fa24e4949b2c34341cbbedf00421e9.tar.gz
kolla-c9f93c30c1fa24e4949b2c34341cbbedf00421e9.zip
Add enabled flag for sources
Sometimes it might be useful to disable a source for an image, e.g. for a plugin that is not used. This may be to reduce image sizes, or restrict the dependencies necessary to build images. This change adds a new 'enabled' option to each source definition. This allows sources, plugins or additions for each source image to be disabled individually. Change-Id: I31ee0744574fb3db96bee2e9f545600de53d9ee4
Diffstat (limited to 'kolla/common')
-rwxr-xr-xkolla/common/config.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/kolla/common/config.py b/kolla/common/config.py
index 25e582132..aff96fbf0 100755
--- a/kolla/common/config.py
+++ b/kolla/common/config.py
@@ -955,7 +955,7 @@ USERS = {
}
-def get_source_opts(type_=None, location=None, reference=None):
+def get_source_opts(type_=None, location=None, reference=None, enabled=True):
return [cfg.StrOpt('type', choices=['local', 'git', 'url'],
default=type_,
help='Source location type'),
@@ -963,7 +963,9 @@ def get_source_opts(type_=None, location=None, reference=None):
help='The location for source install'),
cfg.StrOpt('reference', default=reference,
help=('Git reference to pull, commit sha, tag '
- 'or branch name'))]
+ 'or branch name')),
+ cfg.BoolOpt('enabled', default=enabled,
+ help=('Whether the source is enabled'))]
def get_user_opts(uid, gid, group):
@@ -990,7 +992,8 @@ def gen_all_source_opts():
type_ = params['type']
location = params['location']
reference = params.get('reference')
- yield name, get_source_opts(type_, location, reference)
+ enabled = params.get('enabled', True)
+ yield name, get_source_opts(type_, location, reference, enabled)
def list_opts():