K8s: Add k8s codegen PR check (#91903)

This commit is contained in:
Todd Treece
2024-08-14 11:06:37 -04:00
committed by GitHub
parent 44290ddf32
commit da6b02a2b0
27 changed files with 363 additions and 456 deletions
+3 -2
View File
@@ -51,7 +51,7 @@ function grafana::codegen::gen_openapi() {
;;
"--include-common-input-dirs")
if [ "$2" == "true" ]; then
COMMON_INPUT_DIRS='"k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/version"'
COMMON_INPUT_DIRS='k8s.io/apimachinery/pkg/apis/meta/v1 k8s.io/apimachinery/pkg/runtime k8s.io/apimachinery/pkg/version'
else
COMMON_INPUT_DIRS=""
fi
@@ -99,6 +99,7 @@ function grafana::codegen::gen_openapi() {
# To support running this from anywhere, first cd into this directory,
# and then install with forced module mode on and fully qualified name.
cd "${KUBE_CODEGEN_ROOT}"
GO111MODULE=on go mod download
BINS=(
openapi-gen
)
@@ -150,7 +151,7 @@ function grafana::codegen::gen_openapi() {
--output-file zz_generated.openapi.go \
--go-header-file "${boilerplate}" \
--output-dir "${root}" \
--output-pkg "${in_pkg_single}" \
--output-pkg "github.com/grafana/grafana/${in_pkg_single}" \
--report-filename "${new_report}" \
${COMMON_INPUT_DIRS} \
"${input_pkgs[@]}"