You've already forked athens-proxy-charts
fix(deployment): mount environment variables and volumes only when enabled
This commit is contained in:
@@ -2,23 +2,23 @@
|
|||||||
|
|
||||||
{{/* annotations */}}
|
{{/* annotations */}}
|
||||||
|
|
||||||
{{- define "athens-proxy.pod.annotations" -}}
|
{{- define "athens-proxy.pod.annotations" }}
|
||||||
{{ include "athens-proxy.annotations" . }}
|
{{- include "athens-proxy.annotations" . }}
|
||||||
{{- if and .Values.config.env.enabled (not .Values.config.env.existingSecret.enabled) -}}
|
{{- if and .Values.config.env.enabled (not .Values.config.env.existingSecret.enabled) }}
|
||||||
{{- printf "checksum/secret-%s: %s" (include "athens-proxy.secrets.env.name" $) (include (print $.Template.BasePath "/secretEnv.yaml") . | sha256sum) }}
|
{{ printf "checksum/secret-%s: %s" (include "athens-proxy.secrets.env.name" $) (include (print $.Template.BasePath "/secretEnv.yaml") . | sha256sum) }}
|
||||||
{{- end -}}
|
{{- end }}
|
||||||
{{- if and .Values.config.downloadMode.enabled (not .Values.config.downloadMode.existingConfigMap.enabled) -}}
|
{{- if and .Values.config.downloadMode.enabled (not .Values.config.downloadMode.existingConfigMap.enabled) }}
|
||||||
{{- printf "checksum/config-map-%s: %s" (include "athens-proxy.configMap.downloadMode.name" $) (include (print $.Template.BasePath "/configMapDownloadMode.yaml") . | sha256sum) }}
|
{{ printf "checksum/config-map-%s: %s" (include "athens-proxy.configMap.downloadMode.name" $) (include (print $.Template.BasePath "/configMapDownloadMode.yaml") . | sha256sum) }}
|
||||||
{{- end -}}
|
{{- end }}
|
||||||
{{- if and .Values.config.gitConfig.enabled (not .Values.config.gitConfig.existingConfigMap.enabled) -}}
|
{{- if and .Values.config.gitConfig.enabled (not .Values.config.gitConfig.existingConfigMap.enabled) }}
|
||||||
{{- printf "checksum/config-map-%s: %s" (include "athens-proxy.configMap.gitConfig.name" $) (include (print $.Template.BasePath "/configMapGitConfig.yaml") . | sha256sum) }}
|
{{ printf "checksum/config-map-%s: %s" (include "athens-proxy.configMap.gitConfig.name" $) (include (print $.Template.BasePath "/configMapGitConfig.yaml") . | sha256sum) }}
|
||||||
{{- end -}}
|
{{- end }}
|
||||||
{{- if and .Values.config.netrc.enabled (not .Values.config.netrc.existingSecret.enabled) -}}
|
{{- if and .Values.config.netrc.enabled (not .Values.config.netrc.existingSecret.enabled) }}
|
||||||
{{- printf "checksum/secret-%s: %s" (include "athens-proxy.secrets.netrc.name" $) (include (print $.Template.BasePath "/secretNetRC.yaml") . | sha256sum) }}
|
{{ printf "checksum/secret-%s: %s" (include "athens-proxy.secrets.netrc.name" $) (include (print $.Template.BasePath "/secretNetRC.yaml") . | sha256sum) }}
|
||||||
{{- end -}}
|
{{- end }}
|
||||||
{{- if and .Values.config.ssh.enabled (not .Values.config.ssh.existingSecret.enabled) -}}
|
{{- if and .Values.config.ssh.enabled (not .Values.config.ssh.existingSecret.enabled) }}
|
||||||
{{- printf "checksum/secret-%s: %s" (include "athens-proxy.secrets.ssh.name" $) (include (print $.Template.BasePath "/secretSSH.yaml") . | sha256sum) }}
|
{{ printf "checksum/secret-%s: %s" (include "athens-proxy.secrets.ssh.name" $) (include (print $.Template.BasePath "/secretSSH.yaml") . | sha256sum) }}
|
||||||
{{- end -}}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
{{- if not .Values.config.downloadMode.existingConfigMap.enabled }}
|
{{- if and .Values.config.downloadMode.enabled (not .Values.config.downloadMode.existingConfigMap.enabled) }}
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
{{- if not .Values.config.gitConfig.existingConfigMap.enabled }}
|
{{- if and .Values.config.gitConfig.enabled (not .Values.config.gitConfig.existingConfigMap.enabled) }}
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
{{- if not .Values.config.ssh.existingSecret.enabled }}
|
{{- if and .Values.config.ssh.enabled (not .Values.config.ssh.existingSecret.enabled) }}
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
|
@@ -8,14 +8,22 @@ release:
|
|||||||
templates:
|
templates:
|
||||||
- templates/configMapDownloadMode.yaml
|
- templates/configMapDownloadMode.yaml
|
||||||
tests:
|
tests:
|
||||||
|
- it: Skip rending by default.
|
||||||
|
asserts:
|
||||||
|
- hasDocuments:
|
||||||
|
count: 0
|
||||||
|
|
||||||
- it: Skip rending by using existing config map.
|
- it: Skip rending by using existing config map.
|
||||||
set:
|
set:
|
||||||
|
config.downloadMode.enabled: true
|
||||||
config.downloadMode.existingConfigMap.enabled: true
|
config.downloadMode.existingConfigMap.enabled: true
|
||||||
asserts:
|
asserts:
|
||||||
- hasDocuments:
|
- hasDocuments:
|
||||||
count: 0
|
count: 0
|
||||||
|
|
||||||
- it: Rendering by default.
|
- it: Rendering with default values
|
||||||
|
set:
|
||||||
|
config.downloadMode.enabled: true
|
||||||
asserts:
|
asserts:
|
||||||
- hasDocuments:
|
- hasDocuments:
|
||||||
count: 1
|
count: 1
|
||||||
@@ -56,6 +64,7 @@ tests:
|
|||||||
|
|
||||||
- it: Rendering custom annotations and labels.
|
- it: Rendering custom annotations and labels.
|
||||||
set:
|
set:
|
||||||
|
config.downloadMode.enabled: true
|
||||||
config.downloadMode.configMap.annotations:
|
config.downloadMode.configMap.annotations:
|
||||||
foo: bar
|
foo: bar
|
||||||
bar: foo
|
bar: foo
|
||||||
@@ -76,6 +85,7 @@ tests:
|
|||||||
|
|
||||||
- it: Rendering custom configuration
|
- it: Rendering custom configuration
|
||||||
set:
|
set:
|
||||||
|
config.downloadMode.enabled: true
|
||||||
config.downloadMode.configMap.content: |
|
config.downloadMode.configMap.content: |
|
||||||
downloadURL = "https://proxy.golang.org"
|
downloadURL = "https://proxy.golang.org"
|
||||||
mode = "async_redirect"
|
mode = "async_redirect"
|
||||||
|
@@ -8,14 +8,22 @@ release:
|
|||||||
templates:
|
templates:
|
||||||
- templates/configMapGitConfig.yaml
|
- templates/configMapGitConfig.yaml
|
||||||
tests:
|
tests:
|
||||||
|
- it: Skip rending by default.
|
||||||
|
asserts:
|
||||||
|
- hasDocuments:
|
||||||
|
count: 0
|
||||||
|
|
||||||
- it: Skip rending by using existing config map.
|
- it: Skip rending by using existing config map.
|
||||||
set:
|
set:
|
||||||
|
config.gitConfig.enabled: true
|
||||||
config.gitConfig.existingConfigMap.enabled: true
|
config.gitConfig.existingConfigMap.enabled: true
|
||||||
asserts:
|
asserts:
|
||||||
- hasDocuments:
|
- hasDocuments:
|
||||||
count: 0
|
count: 0
|
||||||
|
|
||||||
- it: Rendering by default.
|
- it: Rendering by default.
|
||||||
|
set:
|
||||||
|
config.gitConfig.enabled: true
|
||||||
asserts:
|
asserts:
|
||||||
- hasDocuments:
|
- hasDocuments:
|
||||||
count: 1
|
count: 1
|
||||||
@@ -46,6 +54,7 @@ tests:
|
|||||||
|
|
||||||
- it: Rendering custom annotations and labels.
|
- it: Rendering custom annotations and labels.
|
||||||
set:
|
set:
|
||||||
|
config.gitConfig.enabled: true
|
||||||
config.gitConfig.configMap.annotations:
|
config.gitConfig.configMap.annotations:
|
||||||
foo: bar
|
foo: bar
|
||||||
bar: foo
|
bar: foo
|
||||||
@@ -66,6 +75,7 @@ tests:
|
|||||||
|
|
||||||
- it: Rendering custom configuration
|
- it: Rendering custom configuration
|
||||||
set:
|
set:
|
||||||
|
config.gitConfig.enabled: true
|
||||||
config.gitConfig.configMap.content: |
|
config.gitConfig.configMap.content: |
|
||||||
[url "git@github.com:"]
|
[url "git@github.com:"]
|
||||||
insteadOf = https://github.com/
|
insteadOf = https://github.com/
|
||||||
|
@@ -8,14 +8,22 @@ release:
|
|||||||
templates:
|
templates:
|
||||||
- templates/secretSSH.yaml
|
- templates/secretSSH.yaml
|
||||||
tests:
|
tests:
|
||||||
|
- it: Skip rending by default.
|
||||||
|
asserts:
|
||||||
|
- hasDocuments:
|
||||||
|
count: 0
|
||||||
|
|
||||||
- it: Skip rendering by using existing secret.
|
- it: Skip rendering by using existing secret.
|
||||||
set:
|
set:
|
||||||
|
config.ssh.enabled: true
|
||||||
config.ssh.existingSecret.enabled: true
|
config.ssh.existingSecret.enabled: true
|
||||||
asserts:
|
asserts:
|
||||||
- hasDocuments:
|
- hasDocuments:
|
||||||
count: 0
|
count: 0
|
||||||
|
|
||||||
- it: Rendering ssh secret with default values.
|
- it: Rendering ssh secret with default values.
|
||||||
|
set:
|
||||||
|
config.ssh.enabled: true
|
||||||
asserts:
|
asserts:
|
||||||
- hasDocuments:
|
- hasDocuments:
|
||||||
count: 1
|
count: 1
|
||||||
@@ -51,6 +59,7 @@ tests:
|
|||||||
|
|
||||||
- it: Rendering ssh secret with custom values.
|
- it: Rendering ssh secret with custom values.
|
||||||
set:
|
set:
|
||||||
|
config.ssh.enabled: true
|
||||||
config.ssh.secret.config: |
|
config.ssh.secret.config: |
|
||||||
Host *
|
Host *
|
||||||
IdentityFile ~/.ssh/id_ed25519
|
IdentityFile ~/.ssh/id_ed25519
|
||||||
@@ -90,6 +99,7 @@ tests:
|
|||||||
|
|
||||||
- it: Rendering custom annotations and labels.
|
- it: Rendering custom annotations and labels.
|
||||||
set:
|
set:
|
||||||
|
config.ssh.enabled: true
|
||||||
config.ssh.secret.annotations:
|
config.ssh.secret.annotations:
|
||||||
foo: bar
|
foo: bar
|
||||||
bar: foo
|
bar: foo
|
||||||
|
Reference in New Issue
Block a user