Handle clean up of read only files.

verify-bazel seems to create read only files under its tmp dir.
When it then goes to clean up the tmp dir it fails.
Adding a command prior to delete to make sure we have perms.
This commit is contained in:
Walter Fender 2020-06-03 13:31:18 -07:00
parent e422e9a3f4
commit a47b8d0a3c

View File

@ -37,7 +37,7 @@ fi
rm -f "${KUBE_ROOT}/{pkg/generated,staging/src/k8s.io/apiextensions-apiserver/pkg/client,staging/src/k8s.io/kube-aggregator/pkg/client}/openapi/zz_generated.openapi.go"
_tmpdir="$(kube::realpath "$(mktemp -d -t verify-bazel.XXXXXX)")"
kube::util::trap_add "rm -rf ${_tmpdir}" EXIT
kube::util::trap_add "chmod -R u+rw ${_tmpdir} && rm -rf ${_tmpdir}" EXIT
_tmp_gopath="${_tmpdir}/go"
_tmp_kuberoot="${_tmp_gopath}/src/k8s.io/kubernetes"