mirror of
https://github.com/grafana/grafana.git
synced 2025-07-25 16:23:49 +08:00
K8s: Update common openapi generation scripts (#81857)
This commit is contained in:
@ -39,6 +39,7 @@ function grafana::codegen::gen_openapi() {
|
||||
local out_base=""
|
||||
local report="/dev/null"
|
||||
local update_report=""
|
||||
local include_common_input_dirs=""
|
||||
local boilerplate="${KUBE_CODEGEN_ROOT}/hack/boilerplate.go.txt"
|
||||
local v="${KUBE_VERBOSE:-0}"
|
||||
|
||||
@ -48,6 +49,14 @@ function grafana::codegen::gen_openapi() {
|
||||
in_pkg_single="$2"
|
||||
shift 2
|
||||
;;
|
||||
"--include-common-input-dirs")
|
||||
if [ "$2" == "true" ]; then
|
||||
COMMON_INPUT_DIRS='--input-dirs "k8s.io/apimachinery/pkg/apis/meta/v1" --input-dirs "k8s.io/apimachinery/pkg/runtime" --input-dirs "k8s.io/apimachinery/pkg/version"'
|
||||
else
|
||||
COMMON_INPUT_DIRS=""
|
||||
fi
|
||||
shift 2
|
||||
;;
|
||||
"--output-base")
|
||||
out_base="$2"
|
||||
shift 2
|
||||
@ -143,6 +152,7 @@ function grafana::codegen::gen_openapi() {
|
||||
--output-base "${out_base}" \
|
||||
--output-package "${in_pkg_single}" \
|
||||
--report-filename "${new_report}" \
|
||||
${COMMON_INPUT_DIRS} \
|
||||
"${inputs[@]}"
|
||||
fi
|
||||
|
||||
|
Reference in New Issue
Block a user