forked from carvel-dev/kapp-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen.sh
executable file
·48 lines (39 loc) · 1.89 KB
/
gen.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
set -o xtrace
source hack/utils.sh
export GOPATH="$(go_mod_gopath_hack)"
trap "rm -rf ${GOPATH}" EXIT
KC_PKG="github.com/vmware-tanzu/carvel-kapp-controller"
rm -rf pkg/client
# Based on vendor/k8s.io/code-generator/generate-groups.sh
# (Converted to "go runs" so that there is no dependency on installed binaries.)
echo "Generating deepcopy funcs"
rm -f $(find pkg/apis|grep zz_generated.deepcopy.go)
go run vendor/k8s.io/code-generator/cmd/deepcopy-gen/main.go \
--input-dirs ${KC_PKG}/pkg/apis/kappctrl/v1alpha1,${KC_PKG}/pkg/apis/packaging/v1alpha1,${KC_PKG}/pkg/apis/internalpackaging/v1alpha1 \
-O zz_generated.deepcopy \
--bounding-dirs ${KC_PKG}/pkg/apis \
--go-header-file ./hack/gen-boilerplate.txt
echo "Generating clientset"
go run vendor/k8s.io/code-generator/cmd/client-gen/main.go \
--clientset-name versioned \
--input-base '' \
--input ${KC_PKG}/pkg/apis/kappctrl/v1alpha1,${KC_PKG}/pkg/apis/packaging/v1alpha1,${KC_PKG}/pkg/apis/internalpackaging/v1alpha1 \
--output-package ${KC_PKG}/pkg/client/clientset \
--go-header-file ./hack/gen-boilerplate.txt
echo "Generating listers"
go run vendor/k8s.io/code-generator/cmd/lister-gen/main.go \
--input-dirs ${KC_PKG}/pkg/apis/kappctrl/v1alpha1,${KC_PKG}/pkg/apis/packaging/v1alpha1,${KC_PKG}/pkg/apis/internalpackaging/v1alpha1 \
--output-package ${KC_PKG}/pkg/client/listers \
--go-header-file ./hack/gen-boilerplate.txt
echo "Generating informers"
go run vendor/k8s.io/code-generator/cmd/informer-gen/main.go \
--input-dirs ${KC_PKG}/pkg/apis/kappctrl/v1alpha1,${KC_PKG}/pkg/apis/packaging/v1alpha1,${KC_PKG}/pkg/apis/internalpackaging/v1alpha1 \
--versioned-clientset-package ${KC_PKG}/pkg/client/clientset/versioned \
--listers-package ${KC_PKG}/pkg/client/listers \
--output-package ${KC_PKG}/pkg/client/informers \
--go-header-file ./hack/gen-boilerplate.txt
echo GEN SUCCESS