Skip to content

Commit f0314c7

Browse files
committed
Helm: Added support to mount sftp.json instead of using the generated value
1 parent dc588b2 commit f0314c7

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

deploy/helm/sftp/templates/config-secret.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.configuration }}
12
apiVersion: v1
23
kind: Secret
34
metadata:
@@ -8,4 +9,5 @@ type: Opaque
89
stringData:
910
sftp.json: |-
1011
{{ .Values.configuration | toPrettyJson | nindent 4 }}
12+
{{- end }}
1113

deploy/helm/sftp/templates/deployment.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,33 @@ spec:
3232
- name: ssh
3333
containerPort: 22
3434
protocol: TCP
35+
{{- if or .Values.configuration .Values.storage.volumeMounts }}
3536
volumeMounts:
37+
{{- if .Values.configuration }}
3638
- name: sftp-json
3739
mountPath: "/app"
3840
readOnly: true
41+
{{- end }}
3942
{{- with .Values.storage.volumeMounts }}
4043
{{- toYaml . | nindent 12 }}
4144
{{- end }}
45+
{{- end }}
4246
resources:
4347
{{- toYaml .Values.resources | nindent 12 }}
48+
{{- if or .Values.configuration .Values.storage.volumes }}
4449
volumes:
50+
{{- if .Values.configuration }}
4551
- name: sftp-json
4652
secret:
4753
secretName: {{ include "sftp.fullname" . }}
4854
items:
4955
- key: sftp.json
5056
path: sftp.json
57+
{{- end }}
5158
{{- with .Values.storage.volumes }}
5259
{{- toYaml . | nindent 8 }}
5360
{{- end }}
61+
{{- end }}
5462
{{- with .Values.nodeSelector }}
5563
nodeSelector:
5664
{{- toYaml . | nindent 8 }}

0 commit comments

Comments
 (0)