Merge pull request #65986 from ixdy/verify-generated-files-git-tree-clean

Automatic merge from submit-queue (batch tested with PRs 65993, 65986, 65351, 65996, 65985). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

verify-generated-files: ensure git tree is clean

**What this PR does / why we need it**: If you have uncommitted changes in your tree, `hack/verify-generated-files.sh` will fail spuriously on those changes. Instead of wasting time generating files, just fail fast if the tree isn't clean.

Follow-up to #65882.

**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2018-07-09 20:39:07 -07:00 committed by GitHub
commit 24555bbcb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,6 +21,8 @@ set -o pipefail
export KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. export KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${KUBE_ROOT}/hack/lib/init.sh" source "${KUBE_ROOT}/hack/lib/init.sh"
kube::util::ensure_clean_working_dir
_tmpdir="$(kube::realpath $(mktemp -d -t verify-generated-files.XXXXXX))" _tmpdir="$(kube::realpath $(mktemp -d -t verify-generated-files.XXXXXX))"
kube::util::trap_add "rm -rf ${_tmpdir}" EXIT kube::util::trap_add "rm -rf ${_tmpdir}" EXIT