Skip to content

Commit

Permalink
Fix nil values when upgrading
Browse files Browse the repository at this point in the history
  • Loading branch information
enolfc committed Aug 21, 2024
1 parent 482039b commit 258ccf6
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
27 changes: 14 additions & 13 deletions notebooks-accounting/templates/accounting-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,37 @@ metadata:
data:
config.ini: |
[default]
{{- if .Values.accounting.sitename }}
{{- if ((.Values.accounting).sitename) }}
site={{ .Values.accounting.sitename }}
{{- else }}
# site=EGI-NOTEBOOKS
{{- end }}
{{- if .Values.accounting.cloudType }}
{{- if ((.Values.accounting).cloudType }}
cloud_type={{ .Values.accounting.cloudType }}
{{- else }}
# cloud_type=EGI Notebooks
{{- end }}
{{- if .Values.accounting.service }}
{{- if ((.Values.accounting).service }}
cloud_compute_service={{ .Values.accounting.service }}
{{- else }}
# cloud_compute_service=
{{- end }}
{{- if.Values.debug }}
{{- if (.Values.debug) }}
verbose=1
{{- end }}
{{- if .Values.storage.apelSpool }}
{{- if ((.Values.storage).apelSpool }}
apel_spool={{ .Values.storage.apelSpool }}
{{- else }}
# apel_spool=
{{- end }}
{{- if .Values.storage.notebooksDb }}
{{- if ((.Values.storage).notebooksDb }}
notebooks_db={{ .Values.storage.notebooksDb }}
{{- else }}
# notebooks_db=
{{- end }}
[prometheus]
{{- if .Values.prometheus.url }}
{{- if ((.Values.prometheus).url) }}
url={{ .Values.prometheus.url }}
{{- else }}
# url=http://localhost:8080
Expand All @@ -55,25 +55,26 @@ data:
# EOSC accounting
[eosc]
{{- if .Values.eosc.tokenUrl }}
{{- if ((.Values.eosc).tokenUrl) }}
token_url={{ .Values.eosc.tokenUrl }}
{{- end }}
{{- if .Values.eosc.clientSecret }}
{{- if ((.Values.eosc).clientSecret) }}
client_secret={{ .Values.eosc.clientSecret }}
{{- end }}
{{- if .Values.eosc.clientId }}
{{- if ((.Values.eosc).clientId) }}
client_id={{ .Values.eosc.clientId }}
{{- end }}
{{- if .Values.eosc.accountingUrl }}
{{- if ((.Values.eosc).accountingUrl) }}
accounting_url={{ .Values.eosc.accountingUrl }}
{{- end }}
{{- if .Values.eosc.installationId }}
{{- if ((.Values.eosc).installationId) }}
installation_id={{ .Values.eosc.installationId }}
{{- end }}
{{- if .Values.storage.timestamp }}
{{- if ((.Values.storage).timestamp) }}
timestamp_file={{ .Values.storage.timestamp }}
{{- end }}
{{- if ((.Values.eosc).flavorMetrics) }}
[eosc.flavors]
{{- range $key, $val := .Values.eosc.flavorMetrics }}
{{ $key }}={{ $val }}
Expand Down
2 changes: 1 addition & 1 deletion notebooks-accounting/templates/accounting-cronjob.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
{{- if .Values.accounting.schedule }}
{{- if ((.Values.accounting).schedule) }}
apiVersion: batch/v1
kind: CronJob
metadata:
Expand Down
2 changes: 1 addition & 1 deletion notebooks-accounting/templates/eosc-cronjob.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
{{- if .Values.eosc.schedule }}
{{- if ((.Values.eosc).schedule) }}
apiVersion: batch/v1
kind: CronJob
metadata:
Expand Down
2 changes: 1 addition & 1 deletion notebooks-accounting/templates/ssm-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
{{- if .Values.ssm.schedule }}
{{- if ((.Values.ssm).schedule) }}
kind: ConfigMap
apiVersion: v1
metadata:
Expand Down
2 changes: 1 addition & 1 deletion notebooks-accounting/templates/ssm-cronjob.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
{{- if .Values.ssm.schedule }}
{{- if ((.Values.ssm).schedule) }}
apiVersion: batch/v1
kind: CronJob
metadata:
Expand Down
2 changes: 1 addition & 1 deletion notebooks-accounting/templates/ssm-secret.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
{{- if .Values.ssm.schedule }}
{{- if ((.Values.ssm).schedule) }}
kind: Secret
apiVersion: v1
metadata:
Expand Down

0 comments on commit 258ccf6

Please sign in to comment.