From bf1b9dd8142de03a121795c332c0b9d56f5b6831 Mon Sep 17 00:00:00 2001 From: Daniel Lipovetsky Date: Thu, 18 May 2023 09:36:42 -0700 Subject: [PATCH 1/2] ci: Add GHA workflow to lint helm chart --- .github/workflows/lint-helm-chart.yml | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/lint-helm-chart.yml diff --git a/.github/workflows/lint-helm-chart.yml b/.github/workflows/lint-helm-chart.yml new file mode 100644 index 00000000..e34b4287 --- /dev/null +++ b/.github/workflows/lint-helm-chart.yml @@ -0,0 +1,32 @@ +name: Lint helm chart + +on: + push: + branches: + - master + paths: + - 'helm/sloop/**' + pull_request: + branches: + - "*" + paths: + - 'helm/sloop/**' + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup helm + uses: azure/setup-helm@v3 + with: + version: 'v3.12.0' + + - name: Lint chart + run: | + helm lint helm/sloop From d33149851ae19cf8e410e50fe9f75a4ce6ff8647 Mon Sep 17 00:00:00 2001 From: Daniel Lipovetsky Date: Thu, 18 May 2023 09:21:27 -0700 Subject: [PATCH 2/2] fix: Quote ClusterRole apiGroups values in helm Chart Valid apiGroup values, e.g. '*.mygroup.example.com', must be quoted in the template. Before this change, helm lint failed with this error: [ERROR] templates/clusterrole.yaml: unable to parse YAML: error converting YAML to JSON: yaml: line 92: did not find expected alphabetic or numeric character --- helm/sloop/templates/clusterrole.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/sloop/templates/clusterrole.yaml b/helm/sloop/templates/clusterrole.yaml index ab1b7cd5..fa959a42 100644 --- a/helm/sloop/templates/clusterrole.yaml +++ b/helm/sloop/templates/clusterrole.yaml @@ -91,7 +91,7 @@ rules: {{- with .Values.clusterRole.apiGroups }} - apiGroups: {{- range . }} - - {{ . }} + - {{ . | quote }} {{- end }} resources: - '*'