mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 12:07:47 +00:00
Make vendor-licenses use verify::generated
This commit is contained in:
parent
8a3a299c65
commit
4d6f56d398
@ -24,34 +24,7 @@ set -o nounset
|
|||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
|
||||||
|
|
||||||
# create a nice clean place to put our new licenses
|
source "${KUBE_ROOT}/hack/lib/verify-generated.sh"
|
||||||
mkdir -p "${KUBE_ROOT}/_tmp"
|
|
||||||
_tmpdir="$(mktemp -d "${KUBE_ROOT}/_tmp/kube-licenses.XXXXXX")"
|
|
||||||
#echo "Created workspace: ${_tmpdir}"
|
|
||||||
function cleanup {
|
|
||||||
#echo "Removing workspace: ${_tmpdir}"
|
|
||||||
rm -rf "${_tmpdir}"
|
|
||||||
}
|
|
||||||
kube::util::trap_add cleanup EXIT
|
|
||||||
|
|
||||||
# symlink all vendor subfolders in temp vendor
|
kube::verify::generated "Generated files need to be updated" "Please run 'hack/update-vendor-licenses.sh'" hack/update-vendor-licenses.sh "$@"
|
||||||
mkdir -p "${_tmpdir}/vendor"
|
|
||||||
for child in "${KUBE_ROOT}/vendor"/*
|
|
||||||
do
|
|
||||||
ln -s "${child}" "${_tmpdir}/vendor"
|
|
||||||
done
|
|
||||||
|
|
||||||
ln -s "${KUBE_ROOT}/LICENSE" "${_tmpdir}"
|
|
||||||
ln -s "${KUBE_ROOT}/staging" "${_tmpdir}"
|
|
||||||
|
|
||||||
# Update licenses
|
|
||||||
LICENSE_ROOT="${_tmpdir}" "${KUBE_ROOT}/hack/update-vendor-licenses.sh"
|
|
||||||
|
|
||||||
# Compare licenses
|
|
||||||
if ! _out="$(diff -Naupr -x OWNERS "${KUBE_ROOT}/LICENSES" "${_tmpdir}/LICENSES")"; then
|
|
||||||
echo "Your LICENSES tree is out of date. Run hack/update-vendor-licenses.sh and commit the results." >&2
|
|
||||||
echo "${_out}" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
Loading…
Reference in New Issue
Block a user