From 7ce81f3458e009c4e05f8eb56095ecb11d39feda Mon Sep 17 00:00:00 2001 From: chaosi-zju Date: Wed, 6 Sep 2023 12:31:51 +0800 Subject: [PATCH] fix invalid helm chart Signed-off-by: chaosi-zju --- .github/workflows/lint-chart.yaml | 7 +++++++ charts/karmada/templates/_helpers.tpl | 4 ++++ charts/karmada/templates/karmada-search.yaml | 4 +++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint-chart.yaml b/.github/workflows/lint-chart.yaml index 8dab103aeb57..40743639f704 100644 --- a/.github/workflows/lint-chart.yaml +++ b/.github/workflows/lint-chart.yaml @@ -27,6 +27,13 @@ jobs: with: version: ${{ env.HELM_VERSION }} + - name: Run chart-testing (template) + run: | + helm template --set components={"search,descheduler,schedulerEstimator"} --dependency-update ./charts/karmada --debug > /dev/null + helm template --set components={"search,descheduler,schedulerEstimator"},installMode=component --dependency-update ./charts/karmada --debug > /dev/null + helm template --set installMode=agent --dependency-update ./charts/karmada --debug > /dev/null + helm template --dependency-update ./charts/karmada-operator --debug > /dev/null + # Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and # yamllint (https://github.com/adrienverge/yamllint) which require Python - name: Set up Python diff --git a/charts/karmada/templates/_helpers.tpl b/charts/karmada/templates/_helpers.tpl index 358138a6e556..992fcd0f0db1 100644 --- a/charts/karmada/templates/_helpers.tpl +++ b/charts/karmada/templates/_helpers.tpl @@ -273,6 +273,10 @@ app: {{- include "karmada.name" .}}-search secret: secretName: {{ .Values.search.kubeconfig }} {{- end -}} +{{- end -}} + +{{- define "karmada.search.etcd.cert.volume" -}} +{{ $name := include "karmada.name" . }} - name: etcd-certs secret: {{- if eq .Values.etcd.mode "internal" }} diff --git a/charts/karmada/templates/karmada-search.yaml b/charts/karmada/templates/karmada-search.yaml index aa504866df9d..24988029ab68 100644 --- a/charts/karmada/templates/karmada-search.yaml +++ b/charts/karmada/templates/karmada-search.yaml @@ -91,6 +91,7 @@ spec: {{- toYaml .Values.apiServer.resources | nindent 12 }} volumes: {{- include "karmada.search.kubeconfig.volume" . | nindent 8 }} + {{- include "karmada.search.etcd.cert.volume" . | nindent 8 }} --- apiVersion: v1 kind: Service @@ -165,7 +166,8 @@ spec: - name: {{ $name }}-search-apiservice configMap: name: {{ $name }}-search-apiservice - {{ include "karmada.search.kubeconfig.volume" . | nindent 8 }} + {{- include "karmada.search.kubeconfig.volume" . | nindent 8 }} + {{- include "karmada.search.etcd.cert.volume" . | nindent 8 }} {{- end }} {{ if .Values.search.podDisruptionBudget }}