fix(service-monitor): invalid config.metrics.TOKEN for nil and empty gitea.metrics.token
This commit is contained in:
parent
c0fdc1ea0b
commit
a8984b9a98
@ -278,7 +278,7 @@ https
|
||||
{{- if not (hasKey .Values.gitea.config.metrics "ENABLED") -}}
|
||||
{{- $_ := set .Values.gitea.config.metrics "ENABLED" .Values.gitea.metrics.enabled -}}
|
||||
{{- end -}}
|
||||
{{- if not (hasKey .Values.gitea.config.metrics "TOKEN") -}}
|
||||
{{- if and (not (hasKey .Values.gitea.config.metrics "TOKEN")) (.Values.gitea.metrics.token) -}}
|
||||
{{- $_ := set .Values.gitea.config.metrics "TOKEN" .Values.gitea.metrics.token -}}
|
||||
{{- end -}}
|
||||
{{- /* redis queue */ -}}
|
||||
|
@ -17,3 +17,29 @@ tests:
|
||||
value: |-
|
||||
ENABLED=true
|
||||
TOKEN=somepassword
|
||||
- it: metrics token is empty
|
||||
template: templates/gitea/config.yaml
|
||||
set:
|
||||
gitea:
|
||||
metrics:
|
||||
enabled: true
|
||||
token: ""
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: stringData.metrics
|
||||
value: |-
|
||||
ENABLED=true
|
||||
- it: metrics token is nil
|
||||
template: templates/gitea/config.yaml
|
||||
set:
|
||||
gitea:
|
||||
metrics:
|
||||
enabled: true
|
||||
token:
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: stringData.metrics
|
||||
value: |-
|
||||
ENABLED=true
|
||||
|
Loading…
x
Reference in New Issue
Block a user