-
-
Notifications
You must be signed in to change notification settings - Fork 228
52 lines (43 loc) · 1.26 KB
/
validate-example.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Validate Examples
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
validate-examples:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install yamllint
run: sudo apt-get install -y yamllint
- name: Lint YAML files
run: yamllint --strict ./example
- name: Install kubectl
run: |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
- name: Create k8s Kind Cluster
uses: helm/[email protected]
with:
cluster_name: kind
- name: Apply CRD
run: |
for crd in $(find ./config/crd/bases -type f -name '*.yaml'); do
kubectl create -f $crd
done
- name: Validate CRD Installation
run: |
CRDs=("redis" "redissentinels" "redisclusters" "redisreplications")
for crd in "${CRDs[@]}"; do
kubectl get crd $crd.redis.redis.opstreelabs.in || exit 1
done
- name: Validate CR
run: |
for example in $(find ./example -type f -name '*.yaml'); do
kubectl apply --dry-run=server -f $example
done