-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
CronJob make install failed. #1466
Comments
switch test it on k8s v1.16.7. it worked. the error is under k8s v1.18. |
I am also running into this problem. @chenyg0911 could you share with me the command you used to downgrade your Kubernetes APIs? I've included my go.mod and the errors I'm getting running
|
Oops... I didn't read the error message well enough and didn't realize that the problem is with the server version of Kubernetes, not the linked Go libraries. I restarted my
as a workaround. |
I don't think it's a good idea to do this workaround. We're using the latest kubebuilder version, and it even need lower version kubernetes release! Should we update the tutorial code and fix this issue? |
I ran into the exact same issue with the latest tutorial. And I also saw some discussions about the same issue in kubernetes-sigs/controller-tools#444 Does it mean this will not be fixed in kubebuilder until the issue is fixed in controller-tools? |
Hit the same issue. |
Same issue with k8s 1.19. I think the issue should be reopened. |
@mingliangguo @zzxwill @yaa110 You can create a kustomize patch to get around this pretty trivially. That said, the controller-tools project merged a fix for this with #480; however, it is not in a release at this point in time. Workaround: config/crd/patches/k8s_list_map_keys.yaml - op: replace
path: /spec/validation/openAPIV3Schema/properties/spec/properties/jobTemplate/properties/spec/properties/template/properties/spec/properties/initContainers/items/properties/ports/items/required
value:
- containerPort
- protocol
- op: replace
path: /spec/validation/openAPIV3Schema/properties/spec/properties/jobTemplate/properties/spec/properties/template/properties/spec/properties/containers/items/properties/ports/items/required
value:
- containerPort
- protocol config/crd/kustomization.yaml ...
patchesJson6902:
- target:
group: apiextensions.k8s.io
version: v1beta1
kind: CustomResourceDefinition
name: cronjobs.batch.tutorial.kubebuilder.io
path: patches/k8s_list_map_keys.yaml
... |
The workaround #1466 (comment) shows valid for projects built with v2 go plugin. If you use the go/v3-alpha plugin it should be solved as well. ( kubebuilder init --plugins=go/v3-alpha ) |
follow the qiuck start book to build CronJob, when run
make install
, It failed with:The text was updated successfully, but these errors were encountered: