Skip to content

Commit

Permalink
fix: return to empty and fix helpers to match hydra chart
Browse files Browse the repository at this point in the history
  • Loading branch information
dlahn committed May 14, 2024
1 parent 94fc56a commit 884d3ad
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 10 deletions.
6 changes: 4 additions & 2 deletions helm/charts/keto/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ Create chart name and version as used by the chart label.
Generate the dsn value
*/}}
{{- define "keto.dsn" -}}
{{ if .Values.keto.config.dsn }}
{{- .Values.keto.config.dsn }}
{{- end }}
{{- end -}}

{{/*
Expand Down Expand Up @@ -115,12 +117,12 @@ checksum/keto-secrets: {{ include (print $.Template.BasePath "/secrets.yaml") .
{{- end }}

{{/*
Check the migration type value and fail if unexpected
Check the migration type value and fail if unexpected
*/}}
{{- define "keto.automigration.typeVerification" -}}
{{- if and .Values.keto.automigration.enabled .Values.keto.automigration.type }}
{{- if and (ne .Values.keto.automigration.type "initContainer") (ne .Values.keto.automigration.type "job") }}
{{- fail "keto.automigration.type must be either 'initContainer' or 'job'" -}}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions helm/charts/keto/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
env:
{{- if not ( include "keto.dsn" . ) }}
{{- if not (empty ( include "keto.dsn" . )) }}
- name: DSN
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -179,7 +179,7 @@ spec:
resources:
{{- toYaml $resources | nindent 12 }}
env:
{{- if not ( include "keto.dsn" . ) }}
{{- if not (empty ( include "keto.dsn" . )) }}
- name: DSN
valueFrom:
secretKeyRef:
Expand Down
2 changes: 1 addition & 1 deletion helm/charts/keto/templates/job-migration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ spec:
{{- toYaml . | nindent 10 }}
{{- end }}
env:
{{- if not ( include "keto.dsn" . ) }}
{{- if not (empty ( include "keto.dsn" . )) }}
- name: DSN
valueFrom:
secretKeyRef:
Expand Down
2 changes: 2 additions & 0 deletions helm/charts/kratos/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ Create chart name and version as used by the chart label.
Generate the dsn value
*/}}
{{- define "kratos.dsn" -}}
{{ if .Values.kratos.config.dsn }}
{{- .Values.kratos.config.dsn }}
{{- end }}
{{- end -}}

{{/*
Expand Down
2 changes: 1 addition & 1 deletion helm/charts/kratos/templates/cleanup-cron-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ spec:
- --config
- /etc/config/kratos.yaml
env:
{{- if not ( include "kratos.dsn" . ) }}
{{- if not (empty ( include "kratos.dsn" . )) }}
- name: DSN
valueFrom:
secretKeyRef:
Expand Down
4 changes: 2 additions & 2 deletions helm/charts/kratos/templates/deployment-kratos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
env:
{{- if not ( include "kratos.dsn" . ) }}
{{- if not (empty ( include "kratos.dsn" . )) }}
- name: DSN
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -148,7 +148,7 @@ spec:
{{- end }}
{{- end }}
env:
{{- if not ( include "kratos.dsn" . ) }}
{{- if not (empty ( include "kratos.dsn" . )) }}
- name: DSN
valueFrom:
secretKeyRef:
Expand Down
2 changes: 1 addition & 1 deletion helm/charts/kratos/templates/job-migration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ spec:
args: ["migrate", "sql", "-e", "--yes", "--config", "/etc/config/kratos.yaml"]
{{- end }}
env:
{{- if not ( include "kratos.dsn" . ) }}
{{- if not (empty ( include "kratos.dsn" . )) }}
- name: DSN
valueFrom:
secretKeyRef:
Expand Down
2 changes: 1 addition & 1 deletion helm/charts/kratos/templates/statefulset-mail.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ spec:
value: {{ .Values.statefulSet.log.format }}
- name: LOG_LEVEL
value: {{ .Values.statefulSet.log.level }}
{{- if not ( include "kratos.dsn" . ) }}
{{- if not (empty ( include "kratos.dsn" . )) }}
- name: DSN
valueFrom:
secretKeyRef:
Expand Down

0 comments on commit 884d3ad

Please sign in to comment.