Patch 2.19.5 #45

Merged
stefan merged 19 commits from master into stable 2021-05-17 10:08:39 +00:00
1 changed files with 9 additions and 3 deletions
Showing only changes of commit 5e86d6360e - Show all commits

View File

@ -34,11 +34,17 @@ with open(config_file, 'r') as yaml_contents:
config = yaml.safe_load(yaml_contents.read())
configmap = ''
if 'condition' in config:
configmap = '''{{- if %(condition)s }}
# use index function to make go template happy if '-' in names
if '-' in config['condition']:
tokens = config['condition'].split('.')
configmap = '''{{- if index .Values %(condition)s }}
''' % {'condition': ' '.join(f'"{w}"' for w in tokens[2:])}
else:
configmap = '''{{- if %(condition)s }}
''' % config
else:
configmap = ''
# Base configmap for KubeZero
configmap += '''apiVersion: v1