Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Stavros Foteinopoulos <[email protected]>
  • Loading branch information
stafot committed Aug 8, 2024
1 parent 9c00f2f commit ae141c7
Showing 1 changed file with 135 additions and 60 deletions.
195 changes: 135 additions & 60 deletions charts/mattermost-push-proxy/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,75 +34,150 @@ spec:
- name: {{ include "mattermost-push-proxy.name" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: ["--config", "/mattermost-push-proxy/config/config.json"]
args:
- "--config"
- "/mattermost-push-proxy/config/config.json"
ports:
- containerPort: {{ .Values.service.internalPort }}
volumeMounts:
- mountPath: /mattermost-push-proxy/config/config.json
name: push-config-template
subPath: push-config.json
# Volume Mounts handling based on externalSecrets.enabled
- mountPath: {{ .Values.applePushSettings.authKeyFile }}
name: apple-push-auth-key
subPath: {{ .Values.applePushSettings.authKeyFileName }}
- mountPath: /certs/apple-push-cert.pem
name: apple-push-cert
subPath: apple-push-cert.pem
- mountPath: /certs/apple-rn-push-cert.pem
name: apple-rn-push-cert
subPath: apple-rn-push-cert.pem
- mountPath: /certs/apple-rnbeta-push-cert.pem
name: apple-rnbeta-push-cert
subPath: apple-rnbeta-push-cert.pem
- mountPath: "/mattermost-push-proxy/config/config.json"
name: "push-config-template"
subPath: "push-config.json"
{{- if not .Values.externalSecrets.enabled }}
{{- if .Values.applePushSettings.authKey }}
- mountPath: {{ .Values.applePushSettings.authKeyFile | quote }}
name: "apple-auth-key"
subPath: {{ .Values.applePushSettings.authKeyFileName | quote }}
{{- end }}
{{- if .Values.applePushSettings.apple.privateCert }}
- mountPath: "/certs/apple-push-cert.pem"
name: "apple-push-cert"
subPath: "apple-push-cert.pem"
{{- end }}
{{- if .Values.applePushSettings.apple_rn.privateCert }}
- mountPath: "/certs/apple-rn-push-cert.pem"
name: "apple-rn-push-cert"
subPath: "apple-rn-push-cert.pem"
{{- end }}
{{- if .Values.applePushSettings.apple_rnbeta.privateCert }}
- mountPath: "/certs/apple-rnbeta-push-cert.pem"
name: "apple-rnbeta-push-cert"
subPath: "apple-rnbeta-push-cert.pem"
{{- end }}
{{- if .Values.androidPushSettings.android.serviceFile }}
- mountPath: {{ .Values.androidPushSettings.android.serviceFileLocation | quote }}
name: "android-service-file"
subPath: {{ .Values.androidPushSettings.android.serviceFileName | quote }}
{{- end }}
{{- if .Values.androidPushSettings.android_rn.serviceFile }}
- mountPath: {{ .Values.androidPushSettings.android_rn.serviceFileLocation | quote }}
name: "android-rn-service-file"
subPath: {{ .Values.androidPushSettings.android_rn.serviceFileName | quote }}
{{- end }}
{{- else }}
- mountPath: "{{ .Values.applePushSettings.authKeyFile }}"
name: "common-secret"
subPath: "auth-key-file"
- mountPath: "/certs/apple-push-cert.pem"
name: "common-secret"
subPath: "apple-push-cert.pem"
- mountPath: "/certs/apple-rn-push-cert.pem"
name: "common-secret"
subPath: "apple-rn-push-cert.pem"
- mountPath: "/certs/apple-rnbeta-push-cert.pem"
name: "common-secret"
subPath: "apple-rnbeta-push-cert.pem"
- mountPath: "{{ .Values.androidPushSettings.android.serviceFileLocation }}"
name: android-service-file
subPath: "{{ .Values.androidPushSettings.android.serviceFileName }}"
name: "common-secret"
subPath: "android-service-file"
- mountPath: "{{ .Values.androidPushSettings.android_rn.serviceFileLocation }}"
name: android-rn-service-file
subPath: "{{ .Values.androidPushSettings.android_rn.serviceFileName }}"
name: "common-secret"
subPath: "android-rn-service-file"
{{- end }}
resources:
{{ toYaml .Values.resources | nindent 10 }}
{{ toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: push-config-template
- name: "push-config-template"
configMap:
name: {{ include "mattermost-push-proxy.fullname" . }}-push-config-template
items:
- key: push-config.json
path: push-config.json
# Secret definitions based on externalSecrets.enabled
- name: apple-push-auth-key
- key: "push-config.json"
path: "push-config.json"
{{- if not .Values.externalSecrets.enabled }}
{{- if .Values.applePushSettings.authKey }}
- name: "apple-auth-key"
secret:
secretName: {{ include "mattermost-push-proxy.fullname" . }}-apple-certs
items:
- key: "apple_auth_key"
path: {{ .Values.applePushSettings.authKeyFileName }}
{{- end }}
{{- if .Values.applePushSettings.apple.privateCert }}
- name: "apple-push-cert"
secret:
secretName: {{ include "mattermost-push-proxy.fullname" . }}-apple-certs
items:
- key: "apple_cert"
path: "apple-push-cert.pem"
{{- end }}
{{- if .Values.applePushSettings.apple_rn.privateCert }}
- name: "apple-rn-push-cert"
secret:
secretName: {{ include "mattermost-push-proxy.fullname" . }}-apple-certs
items:
- key: "apple_rn_cert"
path: "apple-rn-push-cert.pem"
{{- end }}
{{- if .Values.applePushSettings.apple_rnbeta.privateCert }}
- name: "apple-rnbeta-push-cert"
secret:
secretName: {{ include "mattermost-push-proxy.fullname" . }}-apple-certs
items:
- key: "apple_rnbeta_cert"
path: "apple-rnbeta-push-cert.pem"
{{- end }}
{{- if .Values.androidPushSettings.android serviceFile }}
- name: "android-service-file"
secret:
secretName: {{ include "mattermost-push-proxy.fullname" . }}-android-service-files
items:
- key: "android_serviceFile"
path: {{ .Values.androidPushSettings.android serviceFileName }}
{{- end }}
{{- if .Values.androidPushSettings.android_rn serviceFile }}
- name: "android-rn-service-file"
secret:
secretName: {{ include "mattermost-push-proxy.fullname" . }}-android-service-files
items:
- key: "android_rn serviceFile"
path: {{ .Values.androidPushSettings.android_rn serviceFileName }}
{{- end }}
{{- else }}
- name: "common-secret"
secret:
secretName: {{ if .Values.externalSecrets.enabled }}{{ include "mattermost-push-proxy.fullname" . }}-secret{{ else }}{{ include "mattermost-push-proxy.fullname" . }}-apple-certs{{ end }}
secretName: {{ include "mattermost-push-proxy.fullname" . }}-secret
items:
- key: apple_auth_key
path: {{ .Values.applePushSettings.authKeyFileName }}
- name: apple-push-cert
secret:
secretName: {{ if .Values.externalSecrets.enabled }}{{ include "mattermost-push-proxy.fullname" . }}-secret{{ else }}{{ include "mattermost-push-proxy.fullname" . }}-apple-certs{{ end }}
items:
- key: apple_cert
path: apple-push-cert.pem
- name: apple-rn-push-cert
secret:
secretName: {{ if .Values.externalSecrets.enabled }}{{ include "mattermost-push-proxy.fullname" . }}-secret{{ else }}{{ include "mattermost-push-proxy.fullname" . }}-apple-certs{{ end }}
items:
- key: apple_rn_cert
path: apple-rn-push-cert.pem
- name: apple-rnbeta-push-cert
secret:
secretName: {{ if .Values.externalSecrets.enabled }}{{ include "mattermost-push-proxy.fullname" . }}-secret{{ else }}{{ include "mattermost-push-proxy.fullname" . }}-apple-certs{{ end }}
items:
- key: apple_rnbeta_cert
path: apple-rnbeta-push-cert.pem
- name: android-service-file
secret:
secretName: {{ if .Values.externalSecrets.enabled }}{{ include "mattermost-push-proxy.fullname" . }}-secret{{ else }}{{ include "mattermost-push-proxy.fullname" . }}-android-service-files{{ end }}
items:
- key: android_serviceFile
path: {{ .Values.androidPushSettings.android.serviceFileName }}
- name: android-rn-service-file
secret:
secretName: {{ if .Values.externalSecrets.enabled }}{{ include "mattermost-push-proxy.fullname" . }}-secret{{ else }}{{ include "mattermost-push-proxy.fullname" . }}-android-service-files{{ end }}
items:
- key: android_rn_serviceFile
path: {{ .Values.androidPushSettings.android_rn.serviceFileName }}
- key: "auth-key-file"
path: "auth-key-file"
- key: "apple_cert"
path: "apple-push-cert.pem"
- key: "apple_rn_cert"
path: "apple-rn-push-cert.pem"
- key: "apple_rnbeta_cert"
path: "apple-rnbeta-push-cert.pem"
- key: "android_serviceFile"
path: "android-service-file"
- key: "android_rn serviceFile"
path: "android-rn-service-file"

0 comments on commit ae141c7

Please sign in to comment.