Fix shellcheck for hack/verify-generated-*

All of the `hack/verify-generated-*` files now pass shellcheck and are
removed from `hack/.shellcheck_failures`.
This commit is contained in:
mattjmcnaughton
2019-02-21 09:45:06 -05:00
parent 139a13d312
commit b4d086f914
9 changed files with 41 additions and 48 deletions

View File

@@ -18,27 +18,27 @@ set -o errexit
set -o nounset
set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
KUBE_REMOTE_RUNTIME_ROOT="${KUBE_ROOT}/pkg/kubelet/apis/cri/runtime/v1alpha2"
source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env
function cleanup {
rm -rf ${KUBE_REMOTE_RUNTIME_ROOT}/_tmp/
rm -rf "${KUBE_REMOTE_RUNTIME_ROOT}/_tmp/"
}
trap cleanup EXIT
mkdir -p ${KUBE_REMOTE_RUNTIME_ROOT}/_tmp
cp ${KUBE_REMOTE_RUNTIME_ROOT}/api.pb.go ${KUBE_REMOTE_RUNTIME_ROOT}/_tmp/
mkdir -p "${KUBE_REMOTE_RUNTIME_ROOT}/_tmp"
cp "${KUBE_REMOTE_RUNTIME_ROOT}/api.pb.go" "${KUBE_REMOTE_RUNTIME_ROOT}/_tmp/"
ret=0
KUBE_VERBOSE=3 "${KUBE_ROOT}/hack/update-generated-runtime.sh"
diff -I "gzipped FileDescriptorProto" -I "0x" -Naupr ${KUBE_REMOTE_RUNTIME_ROOT}/_tmp/api.pb.go ${KUBE_REMOTE_RUNTIME_ROOT}/api.pb.go || ret=$?
diff -I "gzipped FileDescriptorProto" -I "0x" -Naupr "${KUBE_REMOTE_RUNTIME_ROOT}/_tmp/api.pb.go" "${KUBE_REMOTE_RUNTIME_ROOT}/api.pb.go" || ret=$?
if [[ $ret -eq 0 ]]; then
echo "Generated container runtime api is up to date."
cp ${KUBE_REMOTE_RUNTIME_ROOT}/_tmp/api.pb.go ${KUBE_REMOTE_RUNTIME_ROOT}/
cp "${KUBE_REMOTE_RUNTIME_ROOT}/_tmp/api.pb.go" "${KUBE_REMOTE_RUNTIME_ROOT}/"
else
echo "Generated container runtime api is out of date. Please run hack/update-generated-runtime.sh"
exit 1