-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Validation fails for CustomResource with array of pointers #98079
Comments
/triage accepted I know what that happens, and I suspect I know how to fix it (though there are interfaces everywhere in this code so it's hard to modify without breaking compatibility): https://github.com/kubernetes/kube-openapi/blob/master/pkg/util/proto/openapi.go |
Or rather, I think that very specific todo very well highlights the problem: |
@apelisse I bet this is another case for k8s.io/apiextensions-apiserver/pkg/controller/openapi/v2/conversion.go. Note that fixing kubectl is only a long-term fix. As long as old kubectls are around, the bug will show up. |
Yeah, we can probably fix this one fairly easily (we have the same long-term and short-term goals ;-) |
This is also sig-cli since the validation is performed by kubectl. /sig cli |
Hi, @caseydavenport, I can not reproduce it(k8s version 1.20)
Is it related to this PR #95423? |
#95423 is a server-side change, this bug is because of a client-side bug. I don't think it can be related. Are you sure you're reproducing the exact same bug? |
I reproduce it in the way given in |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
We're starting to work on a plan to "address" this. |
This issue has not been updated in over 1 year, and should be re-triaged. You can:
For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/ /remove-triage accepted |
hi @apelisse , would you mind verifying if this is still valid? Thank you :) |
Thanks, this is client-side validation, we can close this since it's addressed by kubernetes/enhancements#2885. (GA in 1.27). |
/triage accepted |
What happened:
I have a CustomResourceDefinition with a schema that includes an array property, where each element of the array is either an integer or null. This is implemented in the CRD like so:
Using the golang client, I am able to properly write instances of the custom resource. However,
kubectl
fails validation with the following error when attempting to edit an instance of the custom resource:This error is duplicated for each "null" entry in the "allocations" array. This can be reproduced simply by using
kubectl edit
on a resource created by the golang client, and then saving the resource with no changes. It seems to be a problem with kubectl validation, sincekubectl edit --validate=false
successfully updates the resource (but hits this other bug instead: #98080).What you expected to happen:
I can modify the custom resource using kubectl without errors or turning off validation.
How to reproduce it (as minimally and precisely as possible):
I encountered this in the context of Calico. If you have a cluster running Calico, you should be able to hit this with the following command:
Then, simply save without changing anything.
Anything else we need to know?:
Environment:
kubectl version
):@liggitt was also able to reproduce on master.
CC @sttts @soltysh
/sig api-machinery
The text was updated successfully, but these errors were encountered: