mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-22 11:17:01 +00:00
Add acceptance tests for duplicated properties
This commit is contained in:
parent
78ed040b7d
commit
937f6f4bc9
2 changed files with 28 additions and 0 deletions
|
|
@ -138,6 +138,16 @@ resetCacheFolder() {
|
||||||
[ "$status" -eq 1 ]
|
[ "$status" -eq 1 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "Fail when parsing a config with duplicate properties and strict set" {
|
||||||
|
run bin/kubeconform -strict -kubernetes-version 1.16.0 fixtures/duplicate_property.yaml
|
||||||
|
[ "$status" -eq 1 ]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "Pass when parsing a config with duplicate properties and strict NOT set" {
|
||||||
|
run bin/kubeconform -kubernetes-version 1.16.0 fixtures/duplicate_property.yaml
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
}
|
||||||
|
|
||||||
@test "Pass when using a valid, preset -schema-location" {
|
@test "Pass when using a valid, preset -schema-location" {
|
||||||
run bin/kubeconform -schema-location default fixtures/valid.yaml
|
run bin/kubeconform -schema-location default fixtures/valid.yaml
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
|
|
|
||||||
18
fixtures/duplicate_property.yaml
Normal file
18
fixtures/duplicate_property.yaml
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: DaemonSet
|
||||||
|
metadata:
|
||||||
|
name: nginx-ds
|
||||||
|
spec:
|
||||||
|
replicas: 2
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
k8s-app: nginx-ds
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: envoy
|
||||||
|
name: envoy
|
||||||
|
containers:
|
||||||
|
- image: nginx
|
||||||
|
name: nginx
|
||||||
Loading…
Reference in a new issue