File tree Expand file tree Collapse file tree 6 files changed +71
-0
lines changed
Expand file tree Collapse file tree 6 files changed +71
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ CRD's currently supported:
1717- contour (adobe fork)
1818- helm-operator
1919- istio
20+ - keda
2021- prometheus-operator
2122- ack dynamodb- and elasticache controllers
2223- elasticsearch opertator
Original file line number Diff line number Diff line change @@ -87,3 +87,4 @@ crd_to_json_schema eck-operator https://raw.githubusercontent.com/elastic/cloud-
8787crd_to_json_schema vault-secrets-operator https://raw.githubusercontent.com/ricoberger/vault-secrets-operator/master/charts/vault-secrets-operator/crds/ricoberger.de_vaultsecrets.yaml
8888crd_to_json_schema vpa https://raw.githubusercontent.com/kubernetes/autoscaler/master/vertical-pod-autoscaler/deploy/vpa-v1-crd-gen.yaml
8989crd_to_json_schema external-secrets-operator https://raw.githubusercontent.com/external-secrets/external-secrets/main/deploy/crds/bundle.yaml
90+ crd_to_json_schema keda https://raw.githubusercontent.com/kedacore/keda/main/config/crd/bases/keda.sh_scaledobjects.yaml
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bats
2+
3+ load ../test_helper
4+
5+ @test " valid ScaledObject" {
6+ run kubeval " ${FIXTURES} /valid.yaml"
7+ [[ $status -eq 0 ]]
8+ [[ $output = " PASS - ${FIXTURES} /valid.yaml contains a valid ScaledObject (test)" ]]
9+ }
10+
11+ @test " invalid ScaledObject" {
12+ run kubeval " ${FIXTURES} /invalid.yaml"
13+ [[ $status -eq 1 ]]
14+ [[ $output = " WARN - ${FIXTURES} /invalid.yaml contains an invalid ScaledObject (test) - scaleTargetRef: scaleTargetRef is required" ]]
15+ }
16+
17+ @test " invalid ScaledObject in strict mode" {
18+ run kubeval --strict " ${FIXTURES} /strict.yaml"
19+ [[ $status -eq 1 ]]
20+ [[ $output = " WARN - ${FIXTURES} /strict.yaml contains an invalid ScaledObject (test) - unknownProperty: Additional property unknownProperty is not allowed" ]]
21+ }
22+
Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion : keda.sh/v1alpha1
3+ kind : ScaledObject
4+ metadata :
5+ name : test
6+ namespace : default
7+ spec :
8+ minReplicaCount : 1
9+ maxReplicaCount : 10
10+ triggers :
11+ - type : cpu
12+ metadata :
13+ type : Utilization
14+ value : " 80"
Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion : keda.sh/v1alpha1
3+ kind : ScaledObject
4+ metadata :
5+ name : test
6+ namespace : default
7+ spec :
8+ scaleTargetRef :
9+ name : test-deployment
10+ minReplicaCount : 1
11+ maxReplicaCount : 10
12+ triggers :
13+ - type : cpu
14+ metadata :
15+ type : Utilization
16+ value : " 80"
17+ unknownProperty : invalid
Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion : keda.sh/v1alpha1
3+ kind : ScaledObject
4+ metadata :
5+ name : test
6+ namespace : default
7+ spec :
8+ scaleTargetRef :
9+ name : test-deployment
10+ minReplicaCount : 1
11+ maxReplicaCount : 10
12+ triggers :
13+ - type : cpu
14+ metadata :
15+ type : Utilization
16+ value : " 80"
You can’t perform that action at this time.
0 commit comments