Skip to content

Commit 8af6906

Browse files
authored
Merge pull request kubernetes#85220 from liggitt/revert-licenses
Revert kubernetes#76586, restructure LICENSES file generation
2 parents e9ce31b + cd4474a commit 8af6906

File tree

220 files changed

+41
-22633
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+41
-22633
lines changed

Godeps/OWNERS

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/common.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,8 @@ function kube::build::copy_output() {
729729
--prune-empty-dirs \
730730
--filter='- /_temp/' \
731731
--filter='+ /vendor/' \
732+
--filter='+ /Godeps/' \
733+
--filter='+ /staging/***/Godeps/**' \
732734
--filter='+ /_output/dockerized/bin/**' \
733735
--filter='+ zz_generated.*' \
734736
--filter='+ generated.proto' \

build/lib/release.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,7 @@ function kube::release::package_node_tarballs() {
187187
cp "${client_bins[@]/#/${LOCAL_OUTPUT_BINPATH}/${platform}/}" \
188188
"${release_stage}/node/bin/"
189189

190-
cp -R "${KUBE_ROOT}/vendor/ALL_LICENSES" "${release_stage}/"
191-
cp "${KUBE_ROOT}/LICENSE" "${release_stage}/LICENSES"
190+
cp "${KUBE_ROOT}/Godeps/LICENSES" "${release_stage}/"
192191

193192
cp "${RELEASE_TARS}/kubernetes-src.tar.gz" "${release_stage}/"
194193

@@ -253,8 +252,7 @@ function kube::release::package_server_tarballs() {
253252
cp "${client_bins[@]/#/${LOCAL_OUTPUT_BINPATH}/${platform}/}" \
254253
"${release_stage}/server/bin/"
255254

256-
cp -R "${KUBE_ROOT}/vendor/ALL_LICENSES" "${release_stage}/"
257-
cp "${KUBE_ROOT}/LICENSE" "${release_stage}/LICENSES"
255+
cp "${KUBE_ROOT}/Godeps/LICENSES" "${release_stage}/"
258256

259257
cp "${RELEASE_TARS}/kubernetes-src.tar.gz" "${release_stage}/"
260258

@@ -567,8 +565,7 @@ EOF
567565

568566
cp -R "${KUBE_ROOT}/docs" "${release_stage}/"
569567
cp "${KUBE_ROOT}/README.md" "${release_stage}/"
570-
cp -R "${KUBE_ROOT}/vendor/ALL_LICENSES" "${release_stage}/"
571-
cp "${KUBE_ROOT}/LICENSE" "${release_stage}/LICENSES"
568+
cp "${KUBE_ROOT}/Godeps/LICENSES" "${release_stage}/"
572569

573570
echo "${KUBE_GIT_VERSION}" > "${release_stage}/version"
574571

build/release-tars/BUILD

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,12 @@ pkg_tar(
6969
],
7070
)
7171

72-
filegroup(
73-
name = "all-licenses-files",
74-
srcs = glob([
75-
"vendor/ALL_LICENSES/*",
76-
]),
77-
visibility = ["//visibility:private"],
78-
)
79-
8072
# Included in node and server tarballs.
8173
filegroup(
8274
name = "license-targets",
8375
srcs = [
84-
":all-licenses-files",
8576
":kubernetes-src.tar.gz",
86-
"//:LICENSE",
77+
"//:Godeps/LICENSES",
8778
],
8879
visibility = ["//visibility:private"],
8980
)
@@ -244,8 +235,7 @@ pkg_tar(
244235
pkg_tar(
245236
name = "kubernetes",
246237
srcs = [
247-
":all-licenses-files",
248-
"//:LICENSE",
238+
"//:Godeps/LICENSES",
249239
"//:README.md",
250240
"//:version",
251241
"//cluster:all-srcs",

cluster/gce/gci/configure.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ function install-kube-binary-config {
421421
mv "${src_dir}/kubelet" "${KUBE_BIN}"
422422
mv "${src_dir}/kubectl" "${KUBE_BIN}"
423423

424-
mv "${KUBE_HOME}/kubernetes/LICENSE" "${KUBE_HOME}"
424+
mv "${KUBE_HOME}/kubernetes/LICENSES" "${KUBE_HOME}"
425425
mv "${KUBE_HOME}/kubernetes/kubernetes-src.tar.gz" "${KUBE_HOME}"
426426
fi
427427

hack/boilerplate/boilerplate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def file_extension(filename):
155155
return os.path.splitext(filename)[1].split(".")[-1].lower()
156156

157157

158-
skipped_dirs = ['third_party', '_gopath', '_output', '.git', 'cluster/env.sh',
158+
skipped_dirs = ['Godeps', 'third_party', '_gopath', '_output', '.git', 'cluster/env.sh',
159159
"vendor", "test/e2e/generated/bindata.go", "hack/boilerplate/test",
160160
"staging/src/k8s.io/kubectl/pkg/generated/bindata.go"]
161161

hack/update-vendor-licenses.sh

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
# Update the vendor/ALL_LICENSES document.
16+
# Update the Godeps/LICENSES document.
1717
# Generates a table of Godep dependencies and their license.
1818
#
1919
# Usage:
@@ -24,15 +24,12 @@
2424
# additionally created files into the vendor auto-generated tree.
2525
#
2626
# Run every time a license file is added/modified within /vendor to
27-
# update /vendor/ALL_LICENSES
27+
# update /Godeps/LICENSES
2828

2929
set -o errexit
3030
set -o nounset
3131
set -o pipefail
3232

33-
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
34-
source "${KUBE_ROOT}/hack/lib/init.sh"
35-
3633
export LANG=C
3734
export LC_ALL=C
3835

@@ -133,6 +130,8 @@ process_content () {
133130
#############################################################################
134131
# MAIN
135132
#############################################################################
133+
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
134+
source "${KUBE_ROOT}/hack/lib/init.sh"
136135

137136
export GO111MODULE=on
138137

@@ -154,19 +153,8 @@ fi
154153
LICENSE_ROOT="${LICENSE_ROOT:-${KUBE_ROOT}}"
155154
cd "${LICENSE_ROOT}"
156155

157-
kube::util::ensure-temp-dir
158-
159-
# Save the genreated LICENSE file for each package temporarily
160-
TMP_LICENSE_FILE="${KUBE_TEMP}/vendor.LICENSES.$$"
161-
162-
# The directory to save all the LICENSE files
163-
VENDOR_LICENSE_DIR="${LICENSE_ROOT}/vendor/ALL_LICENSES"
164-
165-
# The tmp directory to save all the LICENSE files, will move to VENDOR_LICENSE_DIR
166-
TMP_VENDOR_LICENSE_DIR="${KUBE_TEMP}/vendor.LICENSES.DIR.$$"
167-
168-
mkdir -p "${TMP_VENDOR_LICENSE_DIR}"
169-
156+
VENDOR_LICENSE_FILE="Godeps/LICENSES"
157+
TMP_LICENSE_FILE="/tmp/Godeps.LICENSES.$$"
170158
DEPS_DIR="vendor"
171159
declare -Ag CONTENT
172160

@@ -179,8 +167,7 @@ cat "${LICENSE_ROOT}/LICENSE"
179167
echo
180168
echo "= LICENSE $(kube::util::md5 "${LICENSE_ROOT}/LICENSE")"
181169
echo "================================================================================"
182-
) > "${TMP_LICENSE_FILE}"
183-
mv "${TMP_LICENSE_FILE}" "${TMP_VENDOR_LICENSE_DIR}/LICENSE"
170+
) > ${TMP_LICENSE_FILE}
184171

185172
# Loop through every vendored package
186173
for PACKAGE in $(go list -m -json all | jq -r .Path | sort -f); do
@@ -197,10 +184,11 @@ for PACKAGE in $(go list -m -json all | jq -r .Path | sort -f); do
197184
process_content "${PACKAGE}" COPYRIGHT
198185
process_content "${PACKAGE}" COPYING
199186

200-
# copy content and throw error message
201-
{
202-
echo "= ${DEPS_DIR}/${PACKAGE} licensed under: ="
203-
echo
187+
# display content
188+
echo
189+
echo "================================================================================"
190+
echo "= ${DEPS_DIR}/${PACKAGE} licensed under: ="
191+
echo
204192

205193
file=""
206194
if [[ -n "${CONTENT[${PACKAGE}-LICENSE]-}" ]]; then
@@ -223,20 +211,12 @@ Options:
223211
__EOF__
224212
exit 9
225213
fi
226-
227-
cat "${file}"
228-
echo
229-
echo "= ${file} $(kube::util::md5 "${file}")"
230-
} >> "${TMP_LICENSE_FILE}"
231-
214+
cat "${file}"
232215

233-
dest_dir="${TMP_VENDOR_LICENSE_DIR}/${PACKAGE}"
234-
mkdir -p "${dest_dir}"
235-
mv "${TMP_LICENSE_FILE}" "${dest_dir}/LICENSE"
236-
done
237-
238-
if [[ -d "${VENDOR_LICENSE_DIR}" ]]; then
239-
rm -r "${VENDOR_LICENSE_DIR}"
240-
fi
241-
mv "${TMP_VENDOR_LICENSE_DIR}" "${VENDOR_LICENSE_DIR}"
216+
echo
217+
echo "= ${file} $(kube::util::md5 "${file}")"
218+
echo "================================================================================"
219+
echo
220+
done >> ${TMP_LICENSE_FILE}
242221

222+
cat ${TMP_LICENSE_FILE} > ${VENDOR_LICENSE_FILE}

hack/update-vendor.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,10 +340,11 @@ kube::log::status "vendor: updating LICENSES file"
340340
hack/update-vendor-licenses.sh >>"${LOG_FILE}" 2>&1
341341

342342
kube::log::status "vendor: creating OWNERS file"
343-
rm -f "vendor/OWNERS"
344-
cat <<__EOF__ > "vendor/OWNERS"
343+
rm -f "Godeps/OWNERS" "vendor/OWNERS"
344+
cat <<__EOF__ > "Godeps/OWNERS"
345345
# See the OWNERS docs at https://go.k8s.io/owners
346346
347347
approvers:
348348
- dep-approvers
349349
__EOF__
350+
cp "Godeps/OWNERS" "vendor/OWNERS"

hack/verify-vendor-licenses.sh

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,16 @@ function cleanup {
3333
}
3434
kube::util::trap_add cleanup EXIT
3535

36-
#ln -s all subfolder except ALL_LICENSES in vendor
37-
mkdir -p "${_tmpdir}/vendor"
38-
for child in "${KUBE_ROOT}/vendor"/*
39-
do
40-
if [[ "${child}" == "${KUBE_ROOT}/vendor/ALL_LICENSES" ]] ; then
41-
continue
42-
else
43-
ln -s "${child}" "${_tmpdir}/vendor"
44-
fi
45-
done
46-
36+
cp -r "${KUBE_ROOT}/Godeps" "${_tmpdir}/Godeps"
4737
ln -s "${KUBE_ROOT}/LICENSE" "${_tmpdir}"
38+
ln -s "${KUBE_ROOT}/vendor" "${_tmpdir}"
4839
ln -s "${KUBE_ROOT}/staging" "${_tmpdir}"
4940

5041
# Update vendor Licenses
5142
LICENSE_ROOT="${_tmpdir}" "${KUBE_ROOT}/hack/update-vendor-licenses.sh"
5243

5344
# Compare vendor Licenses
54-
if ! _out="$(diff -Naupr "${KUBE_ROOT}/vendor/ALL_LICENSES" "${_tmpdir}/vendor/ALL_LICENSES")"; then
45+
if ! _out="$(diff -Naupr "${KUBE_ROOT}/Godeps/LICENSES" "${_tmpdir}/Godeps/LICENSES")"; then
5546
echo "Your vendor licenses file is out of date. Run hack/update-vendor-licenses.sh and commit the results." >&2
5647
echo "${_out}" >&2
5748
exit 1

hack/verify-vendor.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export GO111MODULE=on
5555

5656
pushd "${_kubetmp}" > /dev/null 2>&1
5757
# Destroy deps in the copy of the kube tree
58-
rm -rf ./vendor
58+
rm -rf ./Godeps/LICENSES ./vendor
5959

6060
# Recreate the vendor tree using the nice clean set we just downloaded
6161
hack/update-vendor.sh

0 commit comments

Comments
 (0)