Skip to content

Commit

Permalink
feat: template configmaps (#703)
Browse files Browse the repository at this point in the history
  • Loading branch information
jagregory authored Sep 27, 2024
1 parent 85bc64b commit e011f35
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
2 changes: 2 additions & 0 deletions hacks/values/hydra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ hydra:
- "foo bar 123 456 lorem 1"
- "foo bar 123 456 lorem 2"
- "foo bar 123 456 lorem 3"
log:
redaction_text: "example template {{ .Release.Name }}"

secret:
enabled: false
Expand Down
2 changes: 2 additions & 0 deletions hacks/values/keto.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ keto:
- keto
config:
dsn: "postgres://postgres:ory@postgresql.default.svc.cluster.local/ory_keto?sslmode=disable&max_conn_lifetime=10s"
log:
redaction_text: "example template {{ .Release.Name }}"
ingress:
read:
enabled: true
Expand Down
2 changes: 2 additions & 0 deletions hacks/values/oathkeeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ oathkeeper:
authenticators:
noop:
enabled: true
log:
redaction_text: "example template {{ .Release.Name }}"

secret:
enabled: true
Expand Down
2 changes: 1 addition & 1 deletion helm/charts/hydra/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Generate the configmap data, redacting secrets
*/}}
{{- define "hydra.configmap" -}}
{{- $config := omit .Values.hydra.config "dsn" "secrets" -}}
{{- toYaml $config -}}
{{- tpl (toYaml $config) . -}}
{{- end -}}
{{/*
Expand Down
2 changes: 1 addition & 1 deletion helm/charts/keto/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Generate the configmap data, redacting secrets
*/}}
{{- define "keto.configmap" -}}
{{- $config := omit .Values.keto.config "dsn" -}}
{{- toYaml $config -}}
{{- tpl (toYaml $config) . -}}
{{- end -}}

{{/*
Expand Down
8 changes: 8 additions & 0 deletions helm/charts/oathkeeper/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ If release name contains chart name it will be used as a full name.
{{- end -}}


{{/*
Generate the configmap data, redacting secrets
*/}}
{{- define "oathkeeper.configmap" -}}
{{- $config := .Values.oathkeeper.config -}}
{{- tpl (toYaml $config) . -}}
{{- end -}}

{{/*
Create a config map name for rules.
If maester is enabled, use the child chart named template to get the value.
Expand Down
6 changes: 2 additions & 4 deletions helm/charts/oathkeeper/templates/configmap-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,5 @@ metadata:
{{ include "oathkeeper.labels" . | indent 4 }}
data:
"config.yaml": |
{{- with .Values.oathkeeper.config -}}
{{- toYaml . | nindent 4 }}
{{- end -}}
{{ end }}
{{- include "oathkeeper.configmap" . | nindent 4 }}
{{ end }}

0 comments on commit e011f35

Please sign in to comment.