Validate manifests with kubeconform

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
Stefan Prodan
2022-12-23 13:23:24 +02:00
parent 0f9c989b68
commit 8bab17843c
4 changed files with 57 additions and 97 deletions
+19 -3
View File
@@ -9,6 +9,9 @@ on:
permissions:
contents: read
env:
KUBERNETES_VERSION: 1.26.0
jobs:
test:
runs-on: ubuntu-latest
@@ -25,6 +28,12 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: 1.19.x
- name: Setup kubectl
uses: azure/setup-kubectl@v3
with:
version: v${{ env.KUBERNETES_VERSION }}
- name: Setup kubeconform
uses: ./.github/actions/kubeconform
- name: Setup Helm
uses: azure/setup-helm@v3
with:
@@ -33,6 +42,13 @@ jobs:
uses: cue-lang/setup-cue@main
- name: Run unit tests
run: make test
- name: Validate Helm chart
run: |
helm lint ./charts/podinfo/
helm template ./charts/podinfo/ | kubeconform -strict -summary -kubernetes-version ${{ env.KUBERNETES_VERSION }}
- name: Validate Kustomize overlay
run: |
kubectl kustomize ./kustomize/ | kubeconform -strict -summary -kubernetes-version ${{ env.KUBERNETES_VERSION }}
- name: Generate CUE definitions
run: make cue-mod
- name: Verify CUE formatting
@@ -48,12 +64,12 @@ jobs:
}
- name: Validate CUE
working-directory: ./cue
run: cue vet --all-errors --concrete .
run: |
cue vet --all-errors --concrete .
cue gen | kubeconform -strict -summary -skip=ServiceMonitor -kubernetes-version ${{ env.KUBERNETES_VERSION }}
- name: Check if working tree is dirty
run: |
if [[ $(git diff --stat) != '' ]]; then
echo 'run make test and commit changes'
exit 1
fi
- name: Validate Helm chart
run: helm lint ./charts/podinfo/