Merge pull request #80 from gimlet-io/new-features
Added ability to refrence an env from an existing configMaps and secrets
This commit is contained in:
@@ -15,4 +15,4 @@ type: library
|
|||||||
# This is the chart version. This version number should be incremented each time you make changes
|
# This is the chart version. This version number should be incremented each time you make changes
|
||||||
# to the chart and its templates, including the app version.
|
# to the chart and its templates, including the app version.
|
||||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||||
version: 0.3.1
|
version: 0.4.0
|
||||||
|
|||||||
@@ -1,10 +1,20 @@
|
|||||||
{{- define "common.envFromRef.tpl" -}}
|
{{- define "common.envFromRef.tpl" -}}
|
||||||
{{- if or (or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets) .Values.secretName -}}
|
{{- if or (or (or (or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets) .Values.secretName) .Values.existingConfigMaps) .Values.existingSecrets -}}
|
||||||
envFrom: &envFrom
|
envFrom: &envFrom
|
||||||
{{- if .Values.vars }}
|
{{- if .Values.vars }}
|
||||||
- configMapRef:
|
- configMapRef:
|
||||||
name: {{ template "common.robustName" .Release.Name }}
|
name: {{ template "common.robustName" .Release.Name }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- range .Values.existingSecrets }}
|
||||||
|
- secretRef:
|
||||||
|
name: {{ .name }}
|
||||||
|
optional: {{ .optional | default false }}
|
||||||
|
{{- end }}
|
||||||
|
{{- range .Values.existingConfigMaps }}
|
||||||
|
- configMapRef:
|
||||||
|
name: {{ .name }}
|
||||||
|
optional: {{ .optional | default false }}
|
||||||
|
{{- end }}
|
||||||
{{- if .Values.secretEnabled }}
|
{{- if .Values.secretEnabled }}
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: {{ include "common.robustName" $.Release.Name }}
|
name: {{ include "common.robustName" $.Release.Name }}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
- name: common
|
- name: common
|
||||||
repository: file://../common
|
repository: file://../common
|
||||||
version: 0.3.1
|
version: 0.4.0
|
||||||
digest: sha256:64689b29ef8b2262efbd5d49bccf40f798698d426dcfdc7c632aaf183a8cc681
|
digest: sha256:d4eccd332ada7362f429e04b82022f5605a02e2d3aa7b9fdf8adaf4f6c9e03eb
|
||||||
generated: "2023-08-18T08:34:24.144108449+02:00"
|
generated: "2023-10-20T10:53:13.982995773+02:00"
|
||||||
|
|||||||
@@ -19,5 +19,5 @@ version: 0.58.0
|
|||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: common
|
- name: common
|
||||||
version: 0.3.1
|
version: 0.4.0
|
||||||
repository: file://../common
|
repository: file://../common
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
- name: common
|
- name: common
|
||||||
repository: file://../common
|
repository: file://../common
|
||||||
version: 0.3.1
|
version: 0.4.0
|
||||||
digest: sha256:64689b29ef8b2262efbd5d49bccf40f798698d426dcfdc7c632aaf183a8cc681
|
digest: sha256:d4eccd332ada7362f429e04b82022f5605a02e2d3aa7b9fdf8adaf4f6c9e03eb
|
||||||
generated: "2023-08-18T08:31:18.469039683+02:00"
|
generated: "2023-10-20T10:52:47.237955041+02:00"
|
||||||
|
|||||||
@@ -19,5 +19,5 @@ version: 0.58.0
|
|||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: common
|
- name: common
|
||||||
version: 0.3.1
|
version: 0.4.0
|
||||||
repository: file://../common
|
repository: file://../common
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -138,7 +138,7 @@ spec:
|
|||||||
- -c
|
- -c
|
||||||
- {{ .Values.sidecar.command | quote }}
|
- {{ .Values.sidecar.command | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets }}
|
{{- if or (or (or (or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets) .Values.secretName) .Values.existingConfigMaps) .Values.existingSecrets }}
|
||||||
envFrom: *envFrom
|
envFrom: *envFrom
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets }}
|
{{- if or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets }}
|
||||||
|
|||||||
@@ -16,5 +16,23 @@ tests:
|
|||||||
name: release-name
|
name: release-name
|
||||||
- it: Should not reference configmap if vars are not set
|
- it: Should not reference configmap if vars are not set
|
||||||
asserts:
|
asserts:
|
||||||
- isNull:
|
- isNull:
|
||||||
|
path: spec.template.spec.containers[0].envFrom
|
||||||
|
|
||||||
|
- it: Should reference to existing configmaps
|
||||||
|
set:
|
||||||
|
existingConfigMaps:
|
||||||
|
- name: firstcm
|
||||||
|
optional: true
|
||||||
|
- name: secondcm
|
||||||
|
optional: true
|
||||||
|
asserts:
|
||||||
|
- contains:
|
||||||
path: spec.template.spec.containers[0].envFrom
|
path: spec.template.spec.containers[0].envFrom
|
||||||
|
content:
|
||||||
|
configMapRef:
|
||||||
|
name: firstcm
|
||||||
|
optional: true
|
||||||
|
configMapRef:
|
||||||
|
name: secondcm
|
||||||
|
optional: true
|
||||||
|
|||||||
@@ -31,3 +31,20 @@ tests:
|
|||||||
content:
|
content:
|
||||||
secretRef:
|
secretRef:
|
||||||
name: release-name
|
name: release-name
|
||||||
|
- it: Should reference to existing secrets
|
||||||
|
set:
|
||||||
|
existingSecrets:
|
||||||
|
- name: firstsecret
|
||||||
|
optional: true
|
||||||
|
- name: secondsecret
|
||||||
|
optional: true
|
||||||
|
asserts:
|
||||||
|
- contains:
|
||||||
|
path: spec.template.spec.containers[0].envFrom
|
||||||
|
content:
|
||||||
|
secretRef:
|
||||||
|
name: firstsecret
|
||||||
|
optional: true
|
||||||
|
secretRef:
|
||||||
|
name: secondsecret
|
||||||
|
optional: true
|
||||||
|
|||||||
Reference in New Issue
Block a user