- Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Bug Report
What did you do?
$ mkdir $GOPATH/src/memcached-operator
$ cd $GOPATH/src/memcached-operator
$ operator-sdk init --domain example.com
$ operator-sdk create api --group webapp --version v1 --kind Guestbook --crd-version=v1
What did you expect to see?
- Has the option to generate the crd-version with v1 or v1beta1
- By default, gen CRD's and webhooks with v1
What did you see instead? Under which circumstances?
Unable to generate them using the v1 and the v1beta1
will be deprecated soon for k8s. See the operator-framework/operator-sdk-samples#137 (comment) which motivates this issue as well. Also, it will not allow users that have been gen CRD's with v1
via the flag migrate to the new layout without manual changes which shows a regression.
Environment
- operator-sdk version: b95f052
Possible solution
- Wrapper Go plugin to allow use the --crd-version as it has for Helm/Ansible
- For CRD only: doc how to customize the Makefile to use
controller-tools crd:crdVersions=v1
. Update the makefile as:
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion) CRD_OPTIONS ?= "crd:crdVersions=v1"
Additional context
In upstream we have the following issues to use v1 by default for v3-alpha. (kubernetes-sigs/kubebuilder#1065, kubernetes-sigs/kubebuilder#933) However, note that we cannot push it for v2 and for sdk shows that we also require to keep the possibility to generate the CRD's and WebHook manifests with both versions which are not required there since they can drop the supportability for old clusters.