fix: allow dashes in chart names for grafana dashboards
This commit is contained in:
parent
d053b3484c
commit
c2f0dd4cd3
@ -34,11 +34,17 @@ with open(config_file, 'r') as yaml_contents:
|
|||||||
config = yaml.safe_load(yaml_contents.read())
|
config = yaml.safe_load(yaml_contents.read())
|
||||||
|
|
||||||
|
|
||||||
|
configmap = ''
|
||||||
if 'condition' in config:
|
if 'condition' in config:
|
||||||
|
# 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 }}
|
configmap = '''{{- if %(condition)s }}
|
||||||
''' % config
|
''' % config
|
||||||
else:
|
|
||||||
configmap = ''
|
|
||||||
|
|
||||||
# Base configmap for KubeZero
|
# Base configmap for KubeZero
|
||||||
configmap += '''apiVersion: v1
|
configmap += '''apiVersion: v1
|
||||||
|
Loading…
Reference in New Issue
Block a user