From fa4f97e77fe188465dc562f15b2cf58b323ecd71 Mon Sep 17 00:00:00 2001 From: Matthew Abbott Date: Mon, 10 Mar 2025 17:30:55 -0500 Subject: [PATCH] DRY the deploySearch settings names --- templates/job-deploy-search.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/templates/job-deploy-search.yaml b/templates/job-deploy-search.yaml index 3cf7795..fbd53dc 100644 --- a/templates/job-deploy-search.yaml +++ b/templates/job-deploy-search.yaml @@ -47,7 +47,8 @@ spec: - name: {{ include "mastodon.fullname" . }}-deploy-search image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- with .Values.mastodon.hooks.deploySearch.resources }} + {{- with .Values.mastodon.hooks.deploySearch }} + {{- with .resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} @@ -55,24 +56,25 @@ spec: - bin/tootctl - search - deploy - {{- with .Values.mastodon.hooks.deploySearch.concurrency }} + {{- with .concurrency }} - '--concurrency' - {{ . | quote }} {{- end }} - {{- if .Values.mastodon.hooks.deploySearch.resetChewy }} + {{- if .resetChewy }} - '--reset-chewy' {{- end }} - {{- with .Values.mastodon.hooks.deploySearch.batchSize }} + {{- with .batchSize }} - '--batch-size' - {{ . | quote }} {{- end }} - {{- with .Values.mastodon.hooks.deploySearch.only }} + {{- with .only }} {{- if not (has . (list "instances" "accounts" "tags" "statuses" "public_statuses")) -}} {{ fail "mastodon.hooks.deploySearch.only: Value must be one of the following words: instances, accounts, tags, statuses, public_statuses"}} {{- end }} - '--only' - {{ . | quote }} {{- end }} + {{- end }} envFrom: - configMapRef: name: {{ include "mastodon.fullname" . }}-env