From 983053f575821762083d0188dab83b40accd029f Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 22 Apr 2024 17:35:34 -0400 Subject: [PATCH] Try kubeconform instead of kubeval --- .github/actions/spelling-data/patterns.txt | 4 ++++ .github/kubeval.sh | 4 ---- .github/validate-kube.sh | 4 ++++ .github/workflows/helm-test.yaml | 16 ++++++++-------- 4 files changed, 16 insertions(+), 12 deletions(-) delete mode 100755 .github/kubeval.sh create mode 100755 .github/validate-kube.sh diff --git a/.github/actions/spelling-data/patterns.txt b/.github/actions/spelling-data/patterns.txt index 86c44b0..4f0bc3e 100644 --- a/.github/actions/spelling-data/patterns.txt +++ b/.github/actions/spelling-data/patterns.txt @@ -9,6 +9,10 @@ # version suffix v# (?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_])) +# hit-count: 1 file-count: 1 +# go install +go install(?:\s+[a-z]+\.[-@\w/.]+)+ + # Questionably acceptable forms of `in to` # Personally, I prefer `log into`, but people object # https://www.tprteaching.com/log-into-log-in-to-login/ diff --git a/.github/kubeval.sh b/.github/kubeval.sh deleted file mode 100755 index 9f4f044..0000000 --- a/.github/kubeval.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -e -for f in charts/*; do - helm template "$f" | kubeval --strict -done diff --git a/.github/validate-kube.sh b/.github/validate-kube.sh new file mode 100755 index 0000000..0c807f9 --- /dev/null +++ b/.github/validate-kube.sh @@ -0,0 +1,4 @@ +#!/bin/sh -e +for f in charts/*; do + helm template "$f" | kubeconform --strict +done diff --git a/.github/workflows/helm-test.yaml b/.github/workflows/helm-test.yaml index 6576cf5..c79f19b 100644 --- a/.github/workflows/helm-test.yaml +++ b/.github/workflows/helm-test.yaml @@ -18,14 +18,14 @@ jobs: with: command: lint - - name: Download kubeval + - name: Download kubeconform run: | - mkdir bin - cd bin - curl -L https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-linux-amd64.tar.gz | - tar zx - pwd >> "$GITHUB_PATH" + go install github.com/yannh/kubeconform/cmd/kubeconform@latest + echo $(go env GOPATH)/bin >> "$GITHUB_PATH" - - name: Run kubeval + - name: debug + run: echo "$PATH" | tr ':' "\n" + + - name: Validate kubernetes objects run: | - ./.github/kubeval.sh + ./.github/validate-kube.sh