Add data mover CRD under v2alpha1 (#6176)

* add data mover CRD under v1alpha1

Signed-off-by: Lyndon-Li <lyonghui@vmware.com>

* data mover CRDs to v2alpha1

Signed-off-by: Lyndon-Li <lyonghui@vmware.com>

* data mover crd changes

Signed-off-by: Lyndon-Li <lyonghui@vmware.com>

---------

Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
This commit is contained in:
lyndon
2023-05-17 03:09:54 +08:00
committed by GitHub
parent fe5182d74c
commit 5b75f35262
57 changed files with 2748 additions and 35 deletions

View File

@@ -14,8 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// This code embeds the CRD manifests in config/crd/v1/bases in
// config/crd/v1/crds/crds.go.
// This code embeds the CRD manifests in ../bases in ../crds/crds.go
package main

View File

@@ -40,20 +40,38 @@ ${GOPATH}/src/k8s.io/code-generator/generate-groups.sh \
all \
github.com/vmware-tanzu/velero/pkg/generated \
github.com/vmware-tanzu/velero/pkg/apis \
"velero:v1" \
"velero:v1,v2alpha1" \
--go-header-file ./hack/boilerplate.go.txt \
--output-base ../../.. \
$@
# Generate apiextensions.k8s.io/v1
# Generate manifests e.g. CRD, RBAC etc.
# Generate CRD for v1.
controller-gen \
crd:crdVersions=v1 \
paths=./pkg/apis/velero/v1/... \
rbac:roleName=velero-perms \
paths=./pkg/controller/... \
output:crd:artifacts:config=config/crd/v1/bases \
object \
paths=./pkg/apis/velero/v1/...
# Generate CRD for v2alpha1.
controller-gen \
crd:crdVersions=v1 \
paths=./pkg/apis/velero/v2alpha1/... \
paths=./pkg/controller/... \
output:crd:artifacts:config=config/crd/v2alpha1/bases \
object \
paths=./pkg/apis/velero/v2alpha1/...
# Generate RBAC.
controller-gen \
paths=./pkg/apis/velero/v1/... \
paths=./pkg/apis/velero/v2alpha1/... \
paths=./pkg/controller/... \
rbac:roleName=velero-perms
go generate ./config/crd/v1/crds
go generate ./config/crd/v2alpha1/crds

View File

@@ -19,7 +19,7 @@ HACK_DIR=$(dirname "${BASH_SOURCE}")
${HACK_DIR}/update-3generated-crd-code.sh
# ensure no changes to generated CRDs
if ! git diff --exit-code config/crd/v1/crds/crds.go >/dev/null; then
if [! git diff --exit-code config/crd/v1/crds/crds.go config/crd/v2alpha1/crds/crds.go >/dev/null]; then
# revert changes to state before running CRD generation to stay consistent
# with code-generator `--verify-only` option which discards generated changes
git checkout config/crd