13
0
Fork 0
mirror of https://github.com/yannh/kubeconform.git synced 2026-07-03 18:09:30 +00:00

only read from stdin when no other files/folders given

This commit is contained in:
Yann Hamon 2021-03-07 23:59:13 +01:00
parent b10927a052
commit 6308d55977
2 changed files with 20 additions and 8 deletions

View file

@ -170,7 +170,7 @@ resetCacheFolder() {
}
@test "Pass when parsing a valid Kubernetes config YAML file explicitly on stdin" {
run bash -c "cat fixtures/valid.yaml | bin/kubeconform -summary"
run bash -c "cat fixtures/valid.yaml | bin/kubeconform -summary -"
[ "$status" -eq 0 ]
[ "$output" = "Summary: 1 resource found parsing stdin - Valid: 1, Invalid: 0, Errors: 0, Skipped: 0" ]
}
@ -180,6 +180,16 @@ resetCacheFolder() {
[ "$status" -eq 1 ]
}
@test "Fail when not passing data to stdin, when implicitly configured to read from stdin" {
run bash -c "bin/kubeconform -summary"
[ "$status" -eq 1 ]
}
@test "Fail when not passing data to stdin, when explicitly configured to read from stdin" {
run bash -c "bin/kubeconform -summary -"
[ "$status" -eq 1 ]
}
@test "Skip when parsing a resource from a kind to skip" {
run bin/kubeconform -verbose -skip ReplicationController fixtures/valid.yaml
[ "$status" -eq 0 ]