-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
area/dependencyIssues or PRs related to dependency changesIssues or PRs related to dependency changes
Milestone
Description
Bug Report
From SDK 1.17.0 release CRD using v1beta1 requires preserveUnknownFields: false to pass in the validations
We need to understand why.
- Is some dependence that was added to the operator-framework/api?
- Should the
preserveUnknownFields: falsebeen set before and the checks were not raising the error? - Should we really fail in this scenario where the
preserveUnknownFields: falseis not set?
What did you do?
Following the steps to reproduce the issue.
- Create the mock project with v1beta1 and a bundle for it: ( you can use the master branch or the latest release 1.19.0 )
$ mkdir test
$ cd test
$ go mod init test
go: creating new go.mod: module test
$ operator-sdk init
$ operator-sdk create api --group crew --version v1 --kind Admiral --controller=true --resource=true --namespaced=false --make=false --crd-version=v1beta1
$ go mod tidy
$ make bundle
…
operator-sdk bundle validate ./bundle
INFO[0000] All validation tests have completed successfully
- Now, edit the CRD to remove the attributed
requires preserveUnknownFields: false
$ vim bundle/manifests/crew.my.domain_admirals.yaml
- Run bundle validate again:
$ operator-sdk bundle validate ./bundle --select-optional suite=operatorframework
ERRO[0000] Error: Field spec.preserveUnknownFields, Value 0xc000c31ac0: spec.preserveUnknownFields: Invalid value: true: cannot set to true, set x-preserve-unknown-fields to true in spec.versions[*].schema instead
See that the error spec.preserveUnknownFields: Invalid value: true: cannot set to true, set x-preserve-unknown-fields to true in spec.versions[*].schema instead will be raised.
- Now, do the same check using SDK 1.16.0:
$ git fetch --all --tags
$ git checkout tags/v1.16.0 -b v1.16.0
$ make install
$ operator-sdk version
You will see that the error spec.preserveUnknownFields: Invalid value: true: cannot set to true, set x-preserve-unknown-fields to true in spec.versions[*].schema instead is NOT raised.
What did you expect to see?
What did you see instead? Under which circumstances?
Environment
Operator type:
Kubernetes cluster type:
$ operator-sdk version
$ go version (if language is Go)
$ kubectl version
Possible Solution
Additional context
Metadata
Metadata
Assignees
Labels
area/dependencyIssues or PRs related to dependency changesIssues or PRs related to dependency changes