mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 18:02:01 +00:00
Prune unused root replace directives
This commit is contained in:
parent
0f37b31206
commit
a9fd8a8a46
@ -358,6 +358,13 @@ done
|
||||
echo "=== tidying root" >> "${LOG_FILE}"
|
||||
go mod tidy >>"${LOG_FILE}" 2>&1
|
||||
|
||||
# prune unused pinned non-local replace directives
|
||||
comm -23 \
|
||||
<(go mod edit -json | jq -r '.Replace[] | select(.New.Path | startswith("./") | not) | .Old.Path' | sort) \
|
||||
<(go list -m -json all | jq -r .Path | sort) |
|
||||
while read -r X; do echo "-dropreplace=${X}"; done |
|
||||
xargs -L 100 go mod edit -fmt
|
||||
|
||||
# disallow transitive dependencies on k8s.io/kubernetes
|
||||
loopback_deps=()
|
||||
kube::util::read-array loopback_deps < <(go mod graph | grep ' k8s.io/kubernetes' || true)
|
||||
|
Loading…
Reference in New Issue
Block a user