From a2ad239853944dda1d615310d8b2ded384567bb1 Mon Sep 17 00:00:00 2001 From: Yann Hamon Date: Sun, 16 Jul 2023 09:39:52 +0200 Subject: [PATCH] Add test validating using CRD that misses explicit draft version --- acceptance.bats | 5 +++++ fixtures/httpproxy.yaml | 13 +++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 fixtures/httpproxy.yaml diff --git a/acceptance.bats b/acceptance.bats index 2a6d94c..ca49c6f 100755 --- a/acceptance.bats +++ b/acceptance.bats @@ -340,3 +340,8 @@ resetCacheFolder() { run xmllint --noout --schema fixtures/junit.xsd output.xml [ "$status" -eq 0 ] } + +@test "passes when trying to use a CRD that does not have the JSONSchema set" { + run bash -c "bin/kubeconform -schema-location default -schema-location 'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json' fixtures/httpproxy.yaml" + [ "$status" -eq 0 ] +} diff --git a/fixtures/httpproxy.yaml b/fixtures/httpproxy.yaml new file mode 100644 index 0000000..7b0bd31 --- /dev/null +++ b/fixtures/httpproxy.yaml @@ -0,0 +1,13 @@ +apiVersion: projectcontour.io/v1 +kind: HTTPProxy +metadata: + name: basic +spec: + virtualhost: + fqdn: foo-basic.example.com + routes: + - conditions: + - prefix: / + services: + - name: s1 + port: 80