-
Notifications
You must be signed in to change notification settings - Fork 423
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
Default value not allowed for in x-kubernetes-list-map-keys #444
Comments
/kind bug |
In a v1beta1 CRD, a property specified as a list-map item key must be a required property. In a v1 CRD it can be a required property or be given a default value |
The example CronJob yaml in controller-tools project also does not work in 1.18
@liggitt , how does CRD authors add default value for core/v1 types used in their CRD like done here? |
@liggitt , to solve this issue? |
@tamalsaha your suggested fix will help the kubebuilder community (and may be worth it)... but we should look to have a solution in controller-tools for all projects that use controller-runtime (in lieu of a core fix that defines how defaults are expressed) |
/cc @jennybuckley |
/cc @jpbetz |
The proper solution is to write a KEP and update the k/api types with the new annotations. See here: kubernetes/kubernetes#91395 My personal hack has been just use my forked api repo with kubebuilder:default annotation. It unblocked me for now. kmodules/api@c8bc107 |
@tamalsaha The solution discussed in the WG API Expression meeting today (which is a WG for api-machinery) is that @jennybuckley is working on a solution (I think for controller-gen). I specifically asked about the need for a KEP with answers being redirected to Jenny is working on it. Here is the meeting agenda: https://docs.google.com/document/d/1CSpNaicbEqKJoW306qaQEBIkwC1mGIcKl3yiB_C0HZk/edit the |
In order to reduce the confusion that this causes, after a discussion with @pwittrock, we were thinking of adding a couple of extra code areas into controller-gen to help here whilst we wait for the eventual upstream solution:
This will at least allow users to move forward today with installing their resources into Kubernetes 1.18 clusters without having to fork |
This is an workaround for k8s 1.18 crd to remove the required field protocol See: - datastax/cass-operator#132 - kubernetes-sigs/controller-tools#444 - operator-framework/operator-sdk#3235
This is an workaround for k8s 1.18 crd to remove the required field protocol See: - datastax/cass-operator#132 - kubernetes-sigs/controller-tools#444 - operator-framework/operator-sdk#3235
Related issue is kubernetes-sigs/controller-tools#444, temporal solution is kubernetes-sigs/controller-tools#480, which is included in v0.4.1
Related issue is kubernetes-sigs/controller-tools#444, temporal solution is kubernetes-sigs/controller-tools#480, which is included in v0.4.1
@munnerz do you think there's a work around meanwhile? |
Move to controller-gen@0.2.0 has at least got me past the issue. I am trying these CRDs and controllers on k8s@v1.18 |
Current hack, moving to |
I filed the issue in k/k: kubernetes/kubernetes#91395
I am cross posting here because I don't know if this is an issue in the upstream CRD validation or the YAML generated by controller-tools.
The text was updated successfully, but these errors were encountered: