Skip to content

Commit

Permalink
Merge pull request #140 from jsafrane/remove-unused-k8s-libs
Browse files Browse the repository at this point in the history
go-get-kubernetes.sh: remove unused k8s libs
  • Loading branch information
k8s-ci-robot committed Apr 15, 2021
2 parents 49b4269 + 5b1de1a commit bc0504a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions go-get-kubernetes.sh
Expand Up @@ -55,6 +55,12 @@ mods=$( (set -x; curl --silent --show-error --fail "https://raw.githubuserconten
sed -n 's|.*k8s.io/\(.*\) => ./staging/src/k8s.io/.*|k8s.io/\1|p'
) || die "failed to determine Kubernetes staging modules"
for mod in $mods; do
if ! (env GO111MODULE=on go mod graph) | grep "$mod@" > /dev/null; then
echo "Kubernetes module $mod is not used, skipping"
# Remove the module from go.mod "replace" that was added by an older version of this script.
(set -x; env GO111MODULE=on go mod edit "-dropreplace=$mod") || die "'go mod edit' failed"
continue
fi
# The presence of a potentially incomplete go.mod file affects this command,
# so move elsewhere.
modinfo=$(set -x; cd /; env GO111MODULE=on go mod download -json "$mod@kubernetes-${k8s}") ||
Expand Down

0 comments on commit bc0504a

Please sign in to comment.