Skip to content

Commit

Permalink
[library-chart] Template for cacerts secret
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaspi committed Oct 23, 2024
1 parent 38951cc commit 2579b49
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/library-chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v2
name: library-chart
version: 1.5.27
version: 1.5.28
type: library
33 changes: 32 additions & 1 deletion charts/library-chart/templates/_secret.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -441,4 +441,35 @@ stringData:
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}


{{/* Name of the CA certificates secret */}}
{{- define "library-chart.secretNameCacerts" -}}
{{- if .Values.certificates }}
{{- $name:= (printf "%s-secretcacerts" (include "library-chart.fullname" .) ) }}
{{- default $name .Values.certificates.secretName }}
{{- else }}
{{- default "default" .Values.certificates.secretName }}
{{- end }}
{{- end }}

{{/* Template to generate a secret for CA certificates */}}
{{- define "library-chart.secretCacerts" -}}
{{- if and .Values.certificates .Values.certificates.cacerts }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "library-chart.secretNameCacerts" . }}
labels:
{{- include "library-chart.labels" . | nindent 4 }}
type: Opaque
stringData:
{{- if regexMatch "^https?://" .Values.certificates.cacerts }}
ca-certs.url: {{ .Values.certificates.cacerts }}
{{- else }}
ca.pem: |
{{- .Values.certificates.cacerts | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
1 change: 0 additions & 1 deletion charts/library-chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

0 comments on commit 2579b49

Please sign in to comment.