Skip to content

Commit

Permalink
Add a secret for proxy environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
ihiverlet authored Sep 10, 2024
1 parent c4fe139 commit 270951f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
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.23
version: 1.5.24
type: library
33 changes: 33 additions & 0 deletions charts/library-chart/templates/_secret.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,39 @@ stringData:
{{- end }}
{{- end }}

{{/* Create the name of the secret Proxy to use */}}
{{- define "library-chart.secretNameProxy" -}}
{{ if (.Values.proxy).enabled}}
{{- $name:= (printf "%s-secretproxy" (include "library-chart.fullname" .) ) }}
{{- default $name (printf "%s-secretproxy" (include "library-chart.fullname" .) ) }}
{{- end }}
{{- end }}

{{/* Template to generate a secret for proxy */}}
{{- define "library-chart.secretProxy" -}}
{{ if (.Values.proxy).enabled}}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "library-chart.secretNameProxy" . }}
labels:
{{- include "library-chart.labels" . | nindent 4 }}
stringData:
{{- if .Values.proxy.httpProxy }}
http_proxy: {{ .Values.proxy.httpProxy | quote }}
HTTP_PROXY: {{ .Values.proxy.httpProxy }}
{{- end }}
{{- if .Values.proxy.httpsProxy }}
https_proxy: {{ .Values.proxy.httpsProxy | quote }}
HTTPS_PROXY: {{ .Values.proxy.httpsProxy | quote }}
{{- end }}
{{- if .Values.proxy.noProxy }}
no_proxy: {{ .Values.proxy.noProxy | quote }}
NO_PROXY: {{ .Values.proxy.noProxy | quote }}
{{- end }}
{{- end }}
{{- end }}

{{/* Create the name of the secret Vault to use */}}
{{- define "library-chart.secretNameVault" -}}
{{- if .Values.vault.enabled }}
Expand Down

0 comments on commit 270951f

Please sign in to comment.