mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Run verify generated files remake in a tmp directory
We already do this in hack/verify-generated-files.sh so we should do it in verify-generated-files-remake.sh as well. The idea is that any local changes made because of code generation should not persist beyond the current run of the script. Change-Id: I7af176773ae16c393dc2b46c006595243c9fa05b
This commit is contained in:
		@@ -21,6 +21,21 @@ set -o pipefail
 | 
			
		||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
 | 
			
		||||
source "${KUBE_ROOT}/hack/lib/init.sh"
 | 
			
		||||
 | 
			
		||||
kube::util::ensure_clean_working_dir
 | 
			
		||||
 | 
			
		||||
_tmpdir="$(kube::realpath $(mktemp -d -t verify-generated-files.XXXXXX))"
 | 
			
		||||
kube::util::trap_add "rm -rf ${_tmpdir}" EXIT
 | 
			
		||||
 | 
			
		||||
_tmp_gopath="${_tmpdir}/go"
 | 
			
		||||
_tmp_kuberoot="${_tmp_gopath}/src/k8s.io/kubernetes"
 | 
			
		||||
mkdir -p "${_tmp_kuberoot}/.."
 | 
			
		||||
cp -a "${KUBE_ROOT}" "${_tmp_kuberoot}/.."
 | 
			
		||||
 | 
			
		||||
cd "${_tmp_kuberoot}"
 | 
			
		||||
 | 
			
		||||
# clean out anything from the temp dir that's not checked in
 | 
			
		||||
git clean -ffxd
 | 
			
		||||
 | 
			
		||||
# $1 = filename pattern as in "zz_generated.$1.go"
 | 
			
		||||
function find_genfiles() {
 | 
			
		||||
    find .                         \
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user