-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
operators postgresql (4.7.5) #955
Conversation
|
Dear @ValClarkson, Affected versions : More info in 'Kubernetes max version in CSV' section here. |
8174f7a
to
f9bc973
Compare
|
f9bc973
to
fc9ff30
Compare
|
fc9ff30
to
fdd7cac
Compare
|
operators/postgresql/4.7.5/manifests/postgresoperator.v4.7.5.clusterserviceversion.yaml
Outdated
Show resolved
Hide resolved
fdd7cac
to
5c9bf34
Compare
|
5c9bf34
to
847df36
Compare
|
Signed-off-by: ValClarkson <[email protected]>
847df36
to
9a9cf8e
Compare
|
@ValClarkson please fix validation errors. Invalid CRD schema, unable to load/parse CRD into an object. |
HI, @J0zi Those errors are related to operator-sdk using the 1.23 k8s library blocking the bundle validation. However, this version of our operator is targeted for k8s 1.21 and below. I think this is being incorrectly flagged, that being said is there any way to get this operator validated with a previous version of the operator-sdk for validation? |
@ValClarkson You can ignore |
Hi @ValClarkson,
That does not seem accurate. if the problem was trying to parse the CRD v1beta1 with k8s api 1.23 this error would not be raised at all. v1beta1 version does NOT exist from k8s api 1.22 and the whole api is not found. See: https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#field-pruning and check this doc: https://kubernetes.io/blog/2019/06/20/crd-structural-schema/#pruning-don-t-preserve-unknown-fields ( from k8s 1.15 ) |
Hi @J0zi and @ValClarkson, See that operator-sdk bundle validate ( using SDK latest version ) will not raise this error with v1beta1 CRDs:
OR
Then, as you can see the statement is inaccurate. |
Hi @J0zi and @ValClarkson, See the PR with it fixed : https://github.com/k8s-operatorhub/community-operators/pull/1108/files |
@camilamacedo86 The issue is with Your example for When I add that detail to your steps, I see different results depending on $ operator-sdk version
operator-sdk version: "v1.16.0", commit: "560044140c4f3d88677e4ef2872931f5bb97f255", kubernetes version: "1.21", go version: "go1.16.13", GOOS: "darwin", GOARCH: "amd64"
$ 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
# Above is the same as your original steps so far. The following is the different.
$ sed -i '' -e '/CRD_OPTIONS/ s/Fields=false/Fields=true/' Makefile
$ grep CRD_OPTIONS Makefile
CRD_OPTIONS ?= "crd:crdVersions={v1beta1},trivialVersions=true,preserveUnknownFields=true"
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$ make bundle
…
operator-sdk bundle validate ./bundle
INFO[0000] All validation tests have completed successfully The validation fails when I repeat this steps with a newer SDK. $ operator-sdk version
operator-sdk version: "v1.19.1", commit: "079d8852ce5b42aa5306a1e33f7ca725ec48d0e3", kubernetes version: "1.23", go version: "go1.17.8", GOOS: "darwin", GOARCH: "amd64"
…
# Above is the same as your original steps so far. The following is the different.
$ sed -i '' -e '/CRD_OPTIONS/ s/Fields=false/Fields=true/' Makefile
$ grep CRD_OPTIONS Makefile
CRD_OPTIONS ?= "crd:crdVersions={v1beta1},trivialVersions=true,preserveUnknownFields=true"
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$ make bundle
…
ERRO[0000] Error: Field spec.preserveUnknownFields, Value 0xc0008ab590: spec.preserveUnknownFields: Invalid value: true: cannot set to true, set x-preserve-unknown-fields to true in spec.versions[*].schema instead
make: *** [bundle] Error 1 |
Thank you for sharing there. If we compare the CRD generate in both scenarios are they == or can we find any diff? |
@camilamacedo86 Setting the values to false does not actually work, and results in the same error from operator-sdk (well the k8's 1.23 library). The only way this works is on older versions of operator-sdk that does not have the 1.23 k8's upstream port. |
Hi @acornett21,
It is not true. By applying the changes https://github.com/k8s-operatorhub/community-operators/pull/1108/files the error is not raised. I tested it locally. If you are guessing the root cause here with SDK only call the checks that are implemented on the operator framework/api. Indeed, SDK is not responsible for the checks but only to call them. |
Hi @cbandy, I did the steps described (#955 (comment)) with SDK master branch:
See:
And I still unable to reproduce the scenario because controller-gen will be setting in this case the See:
The error can only be found if we remove the
Then, by checking the above bundle ( without the spec.preserveUnknownFields ) with SDK "v1.16.0" the error is not faced but it begins to be faced when I use SDK 1.17.0. See that SDK 1.17.0 does not use k8s 1.23:
So the statement about the root cause here is not accurate. |
The issue operator-framework/operator-sdk#5688 was created for we are able to analyse this scenario. |
@camilamacedo86 I think the output of |
To add more clarity, or point out where this error comes from it is coming from here in the k8's library. |
Hi @acornett21 that is true. Really thank you for share that. |
@camilamacedo86 No problem, thanks for creating an issue in |
Thanks submitting your Operator. Please check below list before you create your Pull Request.
New Submissions
Updates to existing Operators
ci.yaml
file according to the update instructions?replaces
property if you chosereplaces-mode
via theupdateGraph
property inci.yaml
?package.yaml
orannotations.yaml
?Your submission should not
Operator Description must contain (in order)
Operator Metadata should contain
Remember that you can preview your CSV here.
--
1 If you feel your Operator does not fit any of the pre-defined categories, file an issue against this repo and explain your need
2 For more information see here