Skip to content

Commit ca2f095

Browse files
authored
Merge pull request kubernetes#114826 from liggitt/fix-license-script
Fix verify-licenses script
2 parents 293bf70 + cafc791 commit ca2f095

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

hack/verify-licenses.sh

+2-12
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,14 @@ packages_flagged=()
5151
packages_url_missing=()
5252
exit_code=0
5353

54-
git remote add licenses https://github.com/kubernetes/kubernetes >/dev/null 2>&1 || true
55-
56-
5754
# Install go-licenses
5855
echo '[INFO] Installing go-licenses...'
59-
pushd "${KUBE_TEMP}" >/dev/null
60-
git clone https://github.com/google/go-licenses.git >/dev/null 2>&1
61-
cd go-licenses
62-
go build -o "${GOPATH}/bin"
63-
popd >/dev/null
64-
56+
go install github.com/google/go-licenses@latest
6557

6658
# Fetching CNCF Approved List Of Licenses
6759
# Refer: https://github.com/cncf/foundation/blob/main/allowed-third-party-license-policy.md
6860
curl -s 'https://spdx.org/licenses/licenses.json' -o "${KUBE_TEMP}"/licenses.json
6961

70-
7162
number_of_licenses=$(jq '.licenses | length' "${KUBE_TEMP}"/licenses.json)
7263
loop_index_length=$(( number_of_licenses - 1 ))
7364

@@ -85,8 +76,7 @@ done
8576

8677
# Scanning go-packages under the project & verifying against the CNCF approved list of licenses
8778
echo '[INFO] Starting license scan on go-packages...'
88-
go-licenses csv --git_remote licenses ./... >> "${KUBE_TEMP}"/licenses.csv 2>/dev/null
89-
79+
go-licenses report ./... >> "${KUBE_TEMP}"/licenses.csv
9080

9181
echo -e 'PACKAGE_NAME LICENSE_NAME LICENSE_URL\n' >> "${KUBE_TEMP}"/approved_licenses.dump
9282
while IFS=, read -r GO_PACKAGE LICENSE_URL LICENSE_NAME

0 commit comments

Comments
 (0)