mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-10 05:30:26 +00:00
Add go_genrule for zz_generated.openapi.go.
Clean zz_generated.openapi.go before running gazel.
This commit is contained in:
@@ -22,6 +22,10 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
go get gopkg.in/mikedanese/gazel.v16/gazel
|
||||
|
||||
# Remove generated files prior to running gazel.
|
||||
# TODO(spxtr): Remove this line once Bazel is the only way to build.
|
||||
rm -f "${KUBE_ROOT}/pkg/generated/openapi/zz_generated.openapi.go"
|
||||
|
||||
for path in ${GOPATH//:/ }; do
|
||||
if [[ -e "${path}/bin/gazel" ]]; then
|
||||
gazel="${path}/bin/gazel"
|
||||
@@ -33,6 +37,7 @@ if [[ -z "${gazel:-}" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
if ! "${gazel}" -validate -print-diff -root="$(kube::realpath ${KUBE_ROOT})" ; then
|
||||
echo
|
||||
echo "Run ./hack/update-bazel.sh"
|
||||
|
Reference in New Issue
Block a user