Skip to content

Commit 7bd860c

Browse files
authored
Don't mount license vol when both license and licenseSecretName is empty (#312)
Signed-off-by: Tamal Saha <tamal@appscode.com>
1 parent 6396e2d commit 7bd860c

File tree

5 files changed

+23
-9
lines changed

5 files changed

+23
-9
lines changed

charts/stash-community/templates/_helpers.tpl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ Returns the appscode license
7373
Returns the appscode license secret name
7474
*/}}
7575
{{- define "appscode.licenseSecretName" -}}
76-
{{- default (printf "%s-license" (include "stash-community.fullname" .)) .Values.licenseSecretName }}
76+
{{- if .Values.licenseSecretName }}
77+
{{- .Values.licenseSecretName -}}
78+
{{- else if .Values.license }}
79+
{{- printf "%s-license" (include "stash-community.fullname" .) -}}
80+
{{- end }}
7781
{{- end }}
7882

7983
{{/*

charts/stash-community/templates/deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ spec:
6161
- --backup-job-psp={{ .Values.security.podSecurityPolicies | join "," }}
6262
- --restore-job-psp={{ .Values.security.podSecurityPolicies | join "," }}
6363
{{- end }}
64-
{{- if or (include "appscode.license" .) (include "appscode.licenseSecretName" .) }}
64+
{{- if include "appscode.licenseSecretName" . }}
6565
- --license-file=/var/run/secrets/appscode/license/key.txt
6666
- --license-apiservice={{ .Values.licenseApiService }}
6767
{{- end }}
@@ -97,7 +97,7 @@ spec:
9797
name: serving-cert
9898
- mountPath: /tmp
9999
name: stash-scratchdir
100-
{{- if or (include "appscode.license" .) (include "appscode.licenseSecretName" .) }}
100+
{{- if include "appscode.licenseSecretName" . }}
101101
- mountPath: /var/run/secrets/appscode/license
102102
name: license
103103
{{- end }}
@@ -129,7 +129,7 @@ spec:
129129
secret:
130130
defaultMode: 420
131131
secretName: {{ include "stash-community.fullname" . }}-apiserver-cert
132-
{{- if or (include "appscode.license" .) (include "appscode.licenseSecretName" .) }}
132+
{{- if include "appscode.licenseSecretName" . }}
133133
- name: license
134134
secret:
135135
defaultMode: 420

charts/stash-enterprise/templates/_helpers.tpl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ Returns the appscode license
7373
Returns the appscode license secret name
7474
*/}}
7575
{{- define "appscode.licenseSecretName" -}}
76-
{{- default (printf "%s-license" (include "stash-enterprise.fullname" .)) .Values.licenseSecretName }}
76+
{{- if .Values.licenseSecretName }}
77+
{{- .Values.licenseSecretName -}}
78+
{{- else if .Values.license }}
79+
{{- printf "%s-license" (include "stash-enterprise.fullname" .) -}}
80+
{{- end }}
7781
{{- end }}
7882

7983
{{/*

charts/stash-enterprise/templates/deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ spec:
6767
- --restore-job-psp={{ .Values.security.podSecurityPolicies | join "," }}
6868
- --nva-psp={{ include "netvol-accessor-psp" .}}
6969
{{- end }}
70-
{{- if or (include "appscode.license" .) (include "appscode.licenseSecretName" .) }}
70+
{{- if include "appscode.licenseSecretName" . }}
7171
- --license-file=/var/run/secrets/appscode/license/key.txt
7272
- --license-apiservice={{ .Values.licenseApiService }}
7373
{{- end }}
@@ -103,7 +103,7 @@ spec:
103103
name: serving-cert
104104
- mountPath: /tmp
105105
name: stash-scratchdir
106-
{{- if or (include "appscode.license" .) (include "appscode.licenseSecretName" .) }}
106+
{{- if include "appscode.licenseSecretName" . }}
107107
- mountPath: /var/run/secrets/appscode/license
108108
name: license
109109
{{- end }}
@@ -135,7 +135,7 @@ spec:
135135
secret:
136136
defaultMode: 420
137137
secretName: {{ include "stash-enterprise.fullname" . }}-apiserver-cert
138-
{{- if or (include "appscode.license" .) (include "appscode.licenseSecretName" .) }}
138+
{{- if include "appscode.licenseSecretName" . }}
139139
- name: license
140140
secret:
141141
defaultMode: 420

charts/stash/templates/_helpers.tpl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@ Returns the appscode license
7272
Returns the appscode license secret name
7373
*/}}
7474
{{- define "appscode.licenseSecretName" -}}
75-
{{- list .Values.licenseSecretName .Values.global.licenseSecretName (printf "%s-license" (include "stash.fullname" .)) | compact | first }}
75+
{{- if .Values.licenseSecretName }}
76+
{{- .Values.licenseSecretName -}}
77+
{{- else if .Values.global.licenseSecretName }}
78+
{{- .Values.global.licenseSecretName -}}
79+
{{- else if (default .Values.global.license .Values.license) }}
80+
{{- printf "%s-license" (include "stash.fullname" .) -}}
81+
{{- end }}
7682
{{- end }}
7783

7884
{{/*

0 commit comments

Comments
 (0)