mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 12:07:47 +00:00
Convert metrics to new codegen
This commit is contained in:
parent
e368f1b25b
commit
1e0b7aab75
@ -21,6 +21,8 @@ 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
|
||||||
@ -28,16 +30,14 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-
|
|||||||
#
|
#
|
||||||
# we skip informers and listers for metrics, because we don't quite support the requisite operations yet
|
# we skip informers and listers for metrics, because we don't quite support the requisite operations yet
|
||||||
# we skip generating the internal clientset as it's not really needed
|
# we skip generating the internal clientset as it's not really needed
|
||||||
"${CODEGEN_PKG}/generate-internal-groups.sh" "deepcopy,conversion" \
|
|
||||||
k8s.io/metrics/pkg/client \
|
kube::codegen::gen_helpers \
|
||||||
k8s.io/metrics/pkg/apis \
|
--input-pkg-root k8s.io/metrics/pkg/apis \
|
||||||
k8s.io/metrics/pkg/apis \
|
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
|
||||||
"metrics:v1alpha1,v1beta1 custom_metrics:v1beta1,v1beta2 external_metrics:v1beta1" \
|
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt"
|
||||||
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
|
|
||||||
--go-header-file "${SCRIPT_ROOT}/hack/boilerplate.go.txt"
|
kube::codegen::gen_client \
|
||||||
"${CODEGEN_PKG}/generate-groups.sh" "client" \
|
--input-pkg-root k8s.io/metrics/pkg/apis \
|
||||||
k8s.io/metrics/pkg/client \
|
--output-pkg-root k8s.io/metrics/pkg/client \
|
||||||
k8s.io/metrics/pkg/apis \
|
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
|
||||||
"metrics:v1alpha1,v1beta1" \
|
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt"
|
||||||
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
|
|
||||||
--go-header-file "${SCRIPT_ROOT}/hack/boilerplate.go.txt"
|
|
||||||
|
Loading…
Reference in New Issue
Block a user