Skip to content

New layout for Go projects do not allow generate the CRDs with v1 version  #3580

@camilamacedo86

Description

@camilamacedo86

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

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.

Metadata

Metadata

Assignees

Labels

language/goIssue is related to a Go operator projectpriority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions