Skip to content

Commit a276c3c

Browse files
committed
kubeval
1 parent 583ba9c commit a276c3c

File tree

2 files changed

+17
-42
lines changed

2 files changed

+17
-42
lines changed

.github/workflows/test.yml

Lines changed: 15 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,20 @@ on:
77
jobs:
88
apply-all-yaml:
99
runs-on: ubuntu-latest
10-
11-
## run a single container k8s control plane:
12-
## couldn't figure how to specify a custom command for the container
13-
## so ended up creating a custom image
14-
#services:
15-
# k3s:
16-
# image: lalyos/k3s:hack
17-
# ports:
18-
# - 8080:8080
19-
# options: >-
20-
# --privileged
21-
2210
steps:
2311
- uses: actions/checkout@v2
24-
25-
# - name: kubectl version
26-
# run: |
27-
# sleep 5
28-
# type kubectl
29-
# kubectl version || true | tee apply.txt
30-
# ls ~/.*
31-
# kubectl create sa default 2>/dev/null || true
32-
# kubectl get sa -A
33-
34-
# - name: check all yaml
35-
# run: |
36-
# for y in [A-Z][a-z]*/**/*.yaml; do
37-
# echo === apply: ${y}
38-
# if kubectl apply -f $y ;then
39-
# kubectl delete -f $y &
40-
# else
41-
# echo === ERROR: $y
42-
# fi
43-
# done |& tee apply.txt
44-
45-
# - name: upload artifact
46-
# uses: actions/upload-artifact@v2
47-
# with:
48-
# name: apply-test-all-yaml
49-
# path: apply.txt
50-
51-
# - name: check apply log for error
52-
# run: |
53-
# if grep -B1 '=== ERROR' apply.txt; then exit 1; fi
12+
- name: install kubeval
13+
run: |
14+
curl -L https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-linux-amd64.tar.gz | tar -zxf -
15+
sudo mv kubeval /usr/local/bin
16+
- name: check all yaml
17+
run: |
18+
comm -3 <(find . | grep yaml$ | sort) <(cat .kubeval-ignore | sort) | xargs -n1 kubeval | tee -a apply.txt
19+
- name: upload artifact
20+
uses: actions/upload-artifact@v2
21+
with:
22+
name: apply-test-all-yaml
23+
path: apply.txt
24+
- name: check apply log for error
25+
run: |
26+
if grep '^ERR' apply.txt; then exit 1; fi

.kubeval-ignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
./cloud-providers/gcp/https-ready-alb/https-ready-alb.yaml
2+
./plugins/examples.yaml

0 commit comments

Comments
 (0)