From ccc19b9d024f471f56199b3b784b1a75b0d26a7b Mon Sep 17 00:00:00 2001 From: Terin Stock Date: Sat, 30 Dec 2023 23:21:05 -0500 Subject: [PATCH] chore(helm): lint and test chart Create a GitHub Action that lints the Helm chart and tests installing to a KinD cluster. Bug: #90 --- .github/workflows/charts.yaml | 32 +++++++++++++++++++ deploy/charts/origin-ca-issuer/Chart.yaml | 2 +- .../templates/issuer-rolebinding.yaml | 4 +-- deploy/charts/origin-ca-issuer/values.yaml | 2 +- 4 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/charts.yaml diff --git a/.github/workflows/charts.yaml b/.github/workflows/charts.yaml new file mode 100644 index 0000000..72f6318 --- /dev/null +++ b/.github/workflows/charts.yaml @@ -0,0 +1,32 @@ +name: Test Charts +on: + - pull_request + - push +jobs: + chart-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: azure/setup-helm@v3 + - uses: actions/setup-python@v4 + with: + python-version: "3.11" + check-latest: true + - uses: helm/chart-testing-action@v2 + - name: chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) + if [[ -n "$changed" ]]; then + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + - name: chart-testing (lint) + # if: steps.list-changed.outputs.changed == 'true' + run: ct lint --target-branch ${{ github.event.repository.default_branch }} + - uses: helm/kind-action@v1 + # if: steps.list-changed.outputs.changed == 'true' + - name: chart-testing (install) + # if: steps.list-changed.outputs.changed == 'true' + run: ct install --target-branch ${{ github.event.repository.default_branch }} diff --git a/deploy/charts/origin-ca-issuer/Chart.yaml b/deploy/charts/origin-ca-issuer/Chart.yaml index bd69a00..dac4771 100644 --- a/deploy/charts/origin-ca-issuer/Chart.yaml +++ b/deploy/charts/origin-ca-issuer/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: origin-ca-issuer -version: 0.5.1 +version: 0.5.2 appVersion: 0.6.1 description: A Helm chart for origin-ca-issuer home: https://github.com/cloudflare/origin-ca-issuer diff --git a/deploy/charts/origin-ca-issuer/templates/issuer-rolebinding.yaml b/deploy/charts/origin-ca-issuer/templates/issuer-rolebinding.yaml index 950dd72..778eea3 100644 --- a/deploy/charts/origin-ca-issuer/templates/issuer-rolebinding.yaml +++ b/deploy/charts/origin-ca-issuer/templates/issuer-rolebinding.yaml @@ -38,6 +38,6 @@ roleRef: name: cert-manager-controller-approve:cert-manager-k8s-cloudflare-com subjects: - kind: ServiceAccount - name: {{ .Values.certmanager.serviceAccountName }} - namespace: {{ .Values.certmanager.namespace }} + name: {{ .Values.cert-manager.serviceAccountName }} + namespace: {{ .Values.cert-manager.namespace }} {{- end }} diff --git a/deploy/charts/origin-ca-issuer/values.yaml b/deploy/charts/origin-ca-issuer/values.yaml index e94b66c..431cb9a 100644 --- a/deploy/charts/origin-ca-issuer/values.yaml +++ b/deploy/charts/origin-ca-issuer/values.yaml @@ -92,6 +92,6 @@ controller: # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#toleration-v1-core tolerations: {} -certmanager: +cert-manager: namespace: cert-manager serviceAccountName: cert-manager