From 1376c9be2c2e8b73dcba84ca1654306df45767c6 Mon Sep 17 00:00:00 2001 From: Alexander Yastrebov Date: Tue, 9 Apr 2024 18:32:45 +0200 Subject: [PATCH] PlatformCredentialsSet: configure spec.preserveUnknownFields=false Explicitly set `preserveUnknownFields: false` to enable strict CRD validation and prohibit unknown fields in test environment first. Conversion of CRD from v1beta1 to v1 (see #2991) resulted in `preserveUnknownFields: true`: ``` $ kubectl --context=example get crd platformcredentialssets.zalando.org -o yaml | grep preserveUnknownFields preserveUnknownFields: true message: 'spec.preserveUnknownFields: Invalid value: true: must be false' ``` and requires explicit false value to reset. See also https://github.com/kubernetes-sigs/controller-tools/issues/476#issuecomment-691519936 Signed-off-by: Alexander Yastrebov --- .../01-platformcredentialsset/customresourcedefinition.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cluster/manifests/01-platformcredentialsset/customresourcedefinition.yaml b/cluster/manifests/01-platformcredentialsset/customresourcedefinition.yaml index fe121346e6..fbc3ce9895 100644 --- a/cluster/manifests/01-platformcredentialsset/customresourcedefinition.yaml +++ b/cluster/manifests/01-platformcredentialsset/customresourcedefinition.yaml @@ -5,6 +5,9 @@ kind: CustomResourceDefinition metadata: name: platformcredentialssets.zalando.org spec: + # {{ if eq .Cluster.Environment "test" }} + preserveUnknownFields: false + # {{ end }} scope: Namespaced group: zalando.org names: