mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-21 19:07:00 +00:00
test with a valid mapping
This commit is contained in:
parent
5cc65b4dc0
commit
c4fcd76214
3 changed files with 18 additions and 0 deletions
|
|
@ -3,3 +3,4 @@ RUN apk --no-cache add ca-certificates parallel libxml2-utils
|
||||||
COPY dist/kubeconform_linux_amd64_v1/kubeconform /code/bin/
|
COPY dist/kubeconform_linux_amd64_v1/kubeconform /code/bin/
|
||||||
COPY acceptance.bats acceptance-nonetwork.bats /code/
|
COPY acceptance.bats acceptance-nonetwork.bats /code/
|
||||||
COPY fixtures /code/fixtures
|
COPY fixtures /code/fixtures
|
||||||
|
COPY scripts/fixtures/mapping_v2-expected.json /code/fixtures/registry/mapping_v2.json
|
||||||
|
|
|
||||||
|
|
@ -345,3 +345,8 @@ resetCacheFolder() {
|
||||||
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"
|
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 ]
|
[ "$status" -eq 0 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "Pass when parsing a valid Kubernetes config with an expected unknown field" {
|
||||||
|
run bin/kubeconform -schema-location default -schema-location 'fixtures/registry/mapping_v2.json' fixtures/expected_unkown_field.yaml
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
}
|
||||||
12
fixtures/expected_unkown_field.yaml
Normal file
12
fixtures/expected_unkown_field.yaml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
apiVersion: getambassador.io/v2
|
||||||
|
kind: Mapping
|
||||||
|
metadata:
|
||||||
|
name: emissary
|
||||||
|
namespace: default
|
||||||
|
spec:
|
||||||
|
# `spec` is tagged with x-kubernetes-preserve-unknown-fields and `ambassador_id` is not declared
|
||||||
|
ambassador_id:
|
||||||
|
- this-ambassador
|
||||||
|
host: some-host.dev
|
||||||
|
prefix: /
|
||||||
|
service: some-service.this-namespace.cluster.local
|
||||||
Loading…
Reference in a new issue