mirror of
https://github.com/kubernetes/sample-controller.git
synced 2025-01-19 07:52:52 +08:00
Convert sample-controller to new codegen
Kubernetes-commit: e368f1b25bf52f4f48946b8a93ecad63b4bca3ad
This commit is contained in:
parent
8ba49a017a
commit
b0e4f83017
@ -21,16 +21,21 @@ set -o pipefail
|
|||||||
SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||||
CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)}
|
CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)}
|
||||||
|
|
||||||
|
source "${CODEGEN_PKG}/kube_codegen.sh"
|
||||||
|
|
||||||
# generate the code with:
|
# generate the code with:
|
||||||
# --output-base because this script should also be able to run inside the vendor dir of
|
# --output-base because this script should also be able to run inside the vendor dir of
|
||||||
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir
|
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir
|
||||||
# instead of the $GOPATH directly. For normal projects this can be dropped.
|
# instead of the $GOPATH directly. For normal projects this can be dropped.
|
||||||
"${CODEGEN_PKG}/generate-groups.sh" "deepcopy,client,informer,lister" \
|
|
||||||
k8s.io/sample-controller/pkg/generated \
|
|
||||||
k8s.io/sample-controller/pkg/apis \
|
|
||||||
samplecontroller:v1alpha1 \
|
|
||||||
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
|
|
||||||
--go-header-file "${SCRIPT_ROOT}"/hack/boilerplate.go.txt
|
|
||||||
|
|
||||||
# To use your own boilerplate text append:
|
kube::codegen::gen_helpers \
|
||||||
# --go-header-file "${SCRIPT_ROOT}"/hack/custom-boilerplate.go.txt
|
--input-pkg-root k8s.io/sample-controller/pkg/apis \
|
||||||
|
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
|
||||||
|
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt"
|
||||||
|
|
||||||
|
kube::codegen::gen_client \
|
||||||
|
--with-watch \
|
||||||
|
--input-pkg-root k8s.io/sample-controller/pkg/apis \
|
||||||
|
--output-pkg-root k8s.io/sample-controller/pkg/generated \
|
||||||
|
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
|
||||||
|
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt"
|
||||||
|
Loading…
Reference in New Issue
Block a user