Skip to content

Commit

Permalink
PlatformCredentialsSet: configure spec.preserveUnknownFields=false
Browse files Browse the repository at this point in the history
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 kubernetes-sigs/controller-tools#476 (comment)

Signed-off-by: Alexander Yastrebov <[email protected]>
  • Loading branch information
AlexanderYastrebov committed Apr 9, 2024
1 parent 49a07b5 commit 1376c9b
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1376c9b

Please sign in to comment.