3
0
mirror of https://github.com/mastodon/chart synced 2025-05-17 20:43:21 +00:00

Use coalesce for simplicity

This commit is contained in:
Tim Campbell 2025-04-08 16:03:14 +02:00
parent f04bcb559f
commit 6f178d6c03
9 changed files with 18 additions and 48 deletions

View File

@ -107,11 +107,8 @@ spec:
- name: system
mountPath: /opt/mastodon/public/system
{{- end }}
{{- if .Values.mastodon.cron.removeMedia.nodeSelector }}
{{- with coalesce .Values.mastodon.cron.removeMedia.nodeSelector .Values.nodeSelector }}
nodeSelector:
{{- .Values.mastodon.cron.removeMedia.nodeSelector | toYaml | nindent 12 }}
{{- else if .Values.nodeSelector }}
nodeSelector:
{{- .Values.nodeSelector | toYaml | nindent 12 }}
{{- . | toYaml | nindent 12 }}
{{- end }}
{{- end }}

View File

@ -258,15 +258,9 @@ spec:
resources:
{{- toYaml (default (default $context.Values.resources $context.Values.mastodon.sidekiq.resources) .resources) | nindent 12 }}
{{- include "mastodon.statsdExporterContainer" $ | indent 8 }}
{{- if .nodeSelector }}
{{- with coalesce .nodeSelector $context.Values.mastodon.sidekiq.nodeSelector $context.Values.nodeSelector }}
nodeSelector:
{{- .nodeSelector | toYaml | nindent 8 }}
{{- else if $context.Values.mastodon.sidekiq.nodeSelector }}
nodeSelector:
{{- $context.Values.mastodon.sidekiq.nodeSelector | toYaml | nindent 8 }}
{{- else if $context.Values.nodeSelector }}
nodeSelector:
{{- $context.Values.nodeSelector | toYaml | nindent 8 }}
{{- . | toYaml | nindent 8 }}
{{- end }}
{{- with $context.Values.tolerations }}
tolerations:

View File

@ -164,12 +164,9 @@ spec:
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.mastodon.streaming.nodeSelector }}
{{- with coalesce .Values.mastodon.streaming.nodeSelector .Values.nodeSelector }}
nodeSelector:
{{- .Values.mastodon.streaming.nodeSelector | toYaml | nindent 8 }}
{{- else if .Values.nodeSelector }}
nodeSelector:
{{- .Values.nodeSelector | toYaml | nindent 8 }}
{{- . | toYaml | nindent 8 }}
{{- end }}
{{- with (default .Values.affinity .Values.mastodon.streaming.affinity) }}
affinity:

View File

@ -272,12 +272,9 @@ spec:
containerPort: {{ .Values.mastodon.metrics.prometheus.port }}
{{- end }}
{{- include "mastodon.statsdExporterContainer" $ | indent 8 }}
{{- if .Values.mastodon.web.nodeSelector }}
{{- with coalesce .Values.mastodon.web.nodeSelector .Values.nodeSelector }}
nodeSelector:
{{- .Values.mastodon.web.nodeSelector | toYaml | nindent 8 }}
{{- else if .Values.nodeSelector }}
nodeSelector:
{{- .Values.nodeSelector | toYaml | nindent 8 }}
{{- . | toYaml | nindent 8 }}
{{- end }}
{{- with (default .Values.affinity .Values.mastodon.web.affinity) }}
affinity:

View File

@ -89,12 +89,9 @@ spec:
volumes:
- name: assets
emptyDir: {}
{{- if .Values.mastodon.hooks.s3Upload.nodeSelector }}
{{- with coalesce .Values.mastodon.hooks.s3Upload.nodeSelector .Values.nodeSelector }}
nodeSelector:
{{- .Values.mastodon.hooks.s3Upload.nodeSelector | toYaml | nindent 8 }}
{{- else if .Values.nodeSelector }}
nodeSelector:
{{- .Values.nodeSelector | toYaml | nindent 8 }}
{{- . | toYaml | nindent 8 }}
{{- end }}
{{- end -}}

View File

@ -95,11 +95,8 @@ spec:
- name: system
mountPath: /opt/mastodon/public/system
{{- end }}
{{- if .Values.mastodon.createAdmin.nodeSelector }}
{{- with coalesce .Values.mastodon.createAdmin.nodeSelector .Values.nodeSelector }}
nodeSelector:
{{- .Values.mastodon.createAdmin.nodeSelector | toYaml | nindent 8 }}
{{- else if .Values.nodeSelector }}
nodeSelector:
{{- .Values.nodeSelector | toYaml | nindent 8 }}
{{- . | toYaml | nindent 8 }}
{{- end }}
{{- end }}

View File

@ -1,10 +1,7 @@
{{- if .Values.mastodon.hooks.dbMigrate.enabled }}
{{- include "mastodon.dbMigrateJob" (merge (dict "preDeploy" false ) .) }}
{{- if .Values.mastodon.hooks.dbMigrate.nodeSelector }}
{{- with coalesce .Values.mastodon.hooks.dbMigrate.nodeSelector .Values.nodeSelector }}
nodeSelector:
{{- .Values.mastodon.hooks.dbMigrate.nodeSelector | toYaml | nindent 8 }}
{{- else if .Values.nodeSelector }}
nodeSelector:
{{- .Values.nodeSelector | toYaml | nindent 8 }}
{{- . | toYaml | nindent 8 }}
{{- end }}
{{- end }}

View File

@ -1,10 +1,7 @@
{{- if .Values.mastodon.hooks.dbMigrate.enabled }}
{{- include "mastodon.dbMigrateJob" (merge (dict "preDeploy" true ) .) }}
{{- if .Values.mastodon.hooks.dbMigrate.nodeSelector }}
{{- with coalesce .Values.mastodon.hooks.dbMigrate.nodeSelector .Values.nodeSelector }}
nodeSelector:
{{- .Values.mastodon.hooks.dbMigrate.nodeSelector | toYaml | nindent 8 }}
{{- else if .Values.nodeSelector }}
nodeSelector:
{{- .Values.nodeSelector | toYaml | nindent 8 }}
{{- . | toYaml | nindent 8 }}
{{- end }}
{{- end }}

View File

@ -1,10 +1,7 @@
{{- if and .Values.mastodon.hooks.dbPrepare.enabled (not .Values.postgresql.enabled) }}
{{- include "mastodon.dbMigrateJob" (merge (dict "prepare" true ) .) }}
{{- if .Values.mastodon.hooks.dbPrepare.nodeSelector }}
{{- with coalesce .Values.mastodon.hooks.dbPrepare.nodeSelector .Values.nodeSelector }}
nodeSelector:
{{- .Values.mastodon.hooks.dbPrepare.nodeSelector | toYaml | nindent 8 }}
{{- else if .Values.nodeSelector }}
nodeSelector:
{{- .Values.nodeSelector | toYaml | nindent 8 }}
{{- . | toYaml | nindent 8 }}
{{- end }}
{{- end }}