test with a valid mapping

This commit is contained in:
Francois Poinsot 2023-11-23 12:44:25 +01:00
parent 5cc65b4dc0
commit c4fcd76214
No known key found for this signature in database
GPG key ID: 8AB46826C7FAEC27
3 changed files with 18 additions and 0 deletions

View file

@ -3,3 +3,4 @@ RUN apk --no-cache add ca-certificates parallel libxml2-utils
COPY dist/kubeconform_linux_amd64_v1/kubeconform /code/bin/
COPY acceptance.bats acceptance-nonetwork.bats /code/
COPY fixtures /code/fixtures
COPY scripts/fixtures/mapping_v2-expected.json /code/fixtures/registry/mapping_v2.json

View file

@ -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"
[ "$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 ]
}

View 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