2018-03-14 21:24:07 +00:00
|
|
|
#!/bin/bash
|
2017-08-02 17:27:17 +00:00
|
|
|
#
|
2019-03-20 19:32:48 +00:00
|
|
|
# Copyright 2017 the Velero contributors.
|
2017-08-02 17:27:17 +00:00
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2018-03-14 21:24:07 +00:00
|
|
|
set -o errexit
|
|
|
|
set -o nounset
|
|
|
|
set -o pipefail
|
|
|
|
set -o xtrace
|
2017-10-23 20:50:20 +00:00
|
|
|
|
2018-03-14 21:24:07 +00:00
|
|
|
if [[ -z "${GOPATH}" ]]; then
|
|
|
|
GOPATH=~/go
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ! -d "${GOPATH}/src/k8s.io/code-generator" ]]; then
|
|
|
|
echo "k8s.io/code-generator missing from GOPATH"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-01-08 18:36:12 +00:00
|
|
|
if ! command -v controller-gen > /dev/null; then
|
|
|
|
echo "controller-gen is missing"
|
2019-09-23 16:25:48 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2018-03-14 21:24:07 +00:00
|
|
|
|
2019-09-23 16:25:48 +00:00
|
|
|
${GOPATH}/src/k8s.io/code-generator/generate-groups.sh \
|
2017-10-25 17:13:28 +00:00
|
|
|
all \
|
2019-09-30 21:26:56 +00:00
|
|
|
github.com/vmware-tanzu/velero/pkg/generated \
|
|
|
|
github.com/vmware-tanzu/velero/pkg/apis \
|
2019-03-27 22:50:00 +00:00
|
|
|
"velero:v1" \
|
2019-09-30 21:26:56 +00:00
|
|
|
--go-header-file ${GOPATH}/src/github.com/vmware-tanzu/velero/hack/boilerplate.go.txt \
|
2017-10-25 17:13:28 +00:00
|
|
|
$@
|
2019-09-23 16:25:48 +00:00
|
|
|
|
2020-01-08 18:36:12 +00:00
|
|
|
controller-gen \
|
2020-01-28 19:04:28 +00:00
|
|
|
crd:crdVersions=v1beta1,preserveUnknownFields=false \
|
2019-09-23 16:25:48 +00:00
|
|
|
output:dir=pkg/generated/crds/manifests \
|
|
|
|
paths=./pkg/apis/velero/v1/...
|
|
|
|
|
|
|
|
go generate ./pkg/generated/crds
|