Skip to content

Conversation

@llxp
Copy link

@llxp llxp commented Oct 10, 2023

This pull request changes the strict mode in such a way, that when there are additional properties in the schema, it throws an error.
It sets additional properties to false in the schema, if strict mode is set.
Also introduces an additional parameter to exclude specific properties using a yaml path.
By default, if no exception is set, the metadata property is excluded, as most k8s yaml schemes are missing it and thus would give out false positives.

@llxp llxp marked this pull request as ready for review October 10, 2023 10:11
@yannh
Copy link
Owner

yannh commented Dec 24, 2023

Hi @llxp ! Could you expand how this is different from the current behaviour for kubeconform? It should already mark tests as failed when -strict is set and additional properties are found? See this test:

kubeconform/acceptance.bats

Lines 136 to 139 in 808e6d4

@test "Fail when parsing a config with additional properties and strict set" {
run bin/kubeconform -strict -kubernetes-version 1.20.0 fixtures/extra_property.yaml
[ "$status" -eq 1 ]
}

What exactly are you trying to achieve?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants