-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
operator-sdk 1.28.0 - Problem generating CRD with corev1.ResourceRequirements type #6382
Comments
I got same problem at operator-sdk 1.28.0 |
Hi, This issue blocks our migration. Any advice how to solve it? |
Same issue here. Any validation markers that can fix this? |
From what I could tell, it seems like this would be an issue with the version of controller-gen that is being used. It looks like the There was an issue created in the controller-tools repo for this same thing: kubernetes-sigs/controller-tools#772 It looks like the workaround for now is to manually bump the controller-gen version in your Makefile to |
We may have to bump controller-gen in the scaffolded projects to solve this. |
Thanks @everettraven ! |
@varshaprasad96 +1 - I think we will need to do this in Kubebuilder though and then pull that in |
An upstream issue is created to address this: kubernetes-sigs/kubebuilder#3313. Adding this to backlog and keeping it open to track till the upstream KB is fixed. |
Hello, is there any movement on this issue? I have changed controller-gen version, but I have this problem.
|
Fixed for me |
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
Stale issues rot after 30d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle rotten |
Rotten issues close after 30d of inactivity. Reopen the issue by commenting /close |
@openshift-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Bug Report
What did you do?
We are upgrading our operator-sdk to 1.28.0 (from 1.25.0). In our CRD types we have a field that is of corev1.ResourceRequirements type.
What did you expect to see?
The generated CRD should be deployed without error.
What did you see instead? Under which circumstances?
When we deploy the generated CRDs to kubernetes it cannot pass
the schema validation. The error message is look like
Error from server (Invalid): error when creating "deploy.yaml": CustomResourceDefinition.apiextensions.k8s.io "activemqartemises.broker.amq.io" is invalid: [spec.versions[0].schema.openAPIV3Schema.properties[spec].properties[deploymentPlan].properties[resources].properties[claims].items.x-kubernetes-map-type: Invalid value: "null": must be atomic as item of a list with x-kubernetes-list-type=set
Environment
Operator type:
/language go
Kubernetes cluster type:
minikube v1.29.0 on Fedora 37
$ operator-sdk version
perator-sdk version: "v1.28.0", commit: "484013d1865c35df2bc5dfea0ab6ea6b434adefa", kubernetes version: "1.26.0", go version: "go1.19.6", GOOS: "linux", GOARCH: "amd64"
$ go version
(if language is Go)go version go1.19.3 linux/amd64
$ kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.3", GitCommit:"434bfd82814af038ad94d62ebe59b133fcb50506", GitTreeState:"clean", BuildDate:"2022-10-12T10:57:26Z", GoVersion:"go1.19.2", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.1", GitCommit:"8f94681cd294aa8cfd3407b8191f6c70214973a4", GitTreeState:"clean", BuildDate:"2023-01-18T15:51:25Z", GoVersion:"go1.19.5", Compiler:"gc", Platform:"linux/amd64"}
Possible Solution
No solution so far but it looks like the resourceRequirements.Claims field (https://github.com/kubernetes/api/blob/master/core/v1/types.go#L2356) causes the problem. This field is generated the following piece in the CRD
and if I remove x-kubernetes-list-type: set manually and the CRD can be deployed without error.
Additional context
The text was updated successfully, but these errors were encountered: