mirror of https://github.com/k3s-io/k3s
fix shellcheck failures of hack/update-generated-runtime-dockerized.sh
parent
257e6863b8
commit
bd7f7fefae
|
@ -43,7 +43,6 @@
|
||||||
./hack/pin-dependency.sh
|
./hack/pin-dependency.sh
|
||||||
./hack/test-integration.sh
|
./hack/test-integration.sh
|
||||||
./hack/test-update-storage-objects.sh
|
./hack/test-update-storage-objects.sh
|
||||||
./hack/update-generated-runtime-dockerized.sh
|
|
||||||
./hack/update-vendor.sh
|
./hack/update-vendor.sh
|
||||||
./hack/verify-api-groups.sh
|
./hack/verify-api-groups.sh
|
||||||
./hack/verify-boilerplate.sh
|
./hack/verify-boilerplate.sh
|
||||||
|
|
|
@ -18,7 +18,7 @@ set -o errexit
|
||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||||
KUBE_REMOTE_RUNTIME_ROOT="${KUBE_ROOT}/staging/src/k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
|
KUBE_REMOTE_RUNTIME_ROOT="${KUBE_ROOT}/staging/src/k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
|
||||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||||
|
|
||||||
|
@ -40,22 +40,24 @@ if [[ -z "$(which protoc)" || "$(protoc --version)" != "libprotoc 3."* ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function cleanup {
|
function cleanup {
|
||||||
rm -f ${KUBE_REMOTE_RUNTIME_ROOT}/api.pb.go.bak
|
rm -f "${KUBE_REMOTE_RUNTIME_ROOT}/api.pb.go.bak"
|
||||||
|
rm -f "${KUBE_REMOTE_RUNTIME_ROOT}/api.pb.go.tmp"
|
||||||
}
|
}
|
||||||
|
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
|
|
||||||
gogopath=$(dirname $(kube::util::find-binary "protoc-gen-gogo"))
|
gogopath=$(dirname "$(kube::util::find-binary "protoc-gen-gogo")")
|
||||||
|
|
||||||
PATH="${gogopath}:${PATH}" \
|
PATH="${gogopath}:${PATH}" \
|
||||||
protoc \
|
protoc \
|
||||||
--proto_path="${KUBE_REMOTE_RUNTIME_ROOT}" \
|
--proto_path="${KUBE_REMOTE_RUNTIME_ROOT}" \
|
||||||
--proto_path="${KUBE_ROOT}/vendor" \
|
--proto_path="${KUBE_ROOT}/vendor" \
|
||||||
--gogo_out=plugins=grpc:${KUBE_REMOTE_RUNTIME_ROOT} ${KUBE_REMOTE_RUNTIME_ROOT}/api.proto
|
--gogo_out=plugins=grpc:"${KUBE_REMOTE_RUNTIME_ROOT}" "${KUBE_REMOTE_RUNTIME_ROOT}/api.proto"
|
||||||
|
|
||||||
# Update boilerplate for the generated file.
|
# Update boilerplate for the generated file.
|
||||||
echo "$(cat hack/boilerplate/boilerplate.generatego.txt ${KUBE_REMOTE_RUNTIME_ROOT}/api.pb.go)" > ${KUBE_REMOTE_RUNTIME_ROOT}/api.pb.go
|
cat hack/boilerplate/boilerplate.generatego.txt "${KUBE_REMOTE_RUNTIME_ROOT}/api.pb.go" > "${KUBE_REMOTE_RUNTIME_ROOT}/api.pb.go.tmp"
|
||||||
|
mv "${KUBE_REMOTE_RUNTIME_ROOT}/api.pb.go.tmp" "${KUBE_REMOTE_RUNTIME_ROOT}/api.pb.go"
|
||||||
|
|
||||||
# Run gofmt to clean up the generated code.
|
# Run gofmt to clean up the generated code.
|
||||||
kube::golang::verify_go_version
|
kube::golang::verify_go_version
|
||||||
gofmt -l -s -w ${KUBE_REMOTE_RUNTIME_ROOT}/api.pb.go
|
gofmt -l -s -w "${KUBE_REMOTE_RUNTIME_ROOT}/api.pb.go"
|
||||||
|
|
Loading…
Reference in New Issue