Skip to content

Commit e688883

Browse files
authored
Merge pull request kubernetes#76522 from liggitt/prune-replace
Prune replace directives
2 parents ed5c7e6 + 498959a commit e688883

File tree

23 files changed

+9
-1685
lines changed

23 files changed

+9
-1685
lines changed

hack/update-vendor.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,19 @@ $(go mod why ${loopback_deps})"
241241

242242
# prune unused pinned replace directives
243243
comm -23 \
244-
<(go mod edit -json | jq -r '.Replace[] | select(.Old.Path == .New.Path) | select(.New.Version != null) | .Old.Path' | sort) \
244+
<(go mod edit -json | jq -r '.Replace[] | .Old.Path' | sort) \
245245
<(go list -m -json all | jq -r .Path | sort) |
246246
xargs -L 1 -I {} echo "-dropreplace={}" |
247247
xargs -L 100 go mod edit -fmt
248248

249+
# prune replace directives that pin to the naturally selected version
250+
go list -m -json all |
251+
jq -r 'select(.Replace != null) |
252+
select(.Path == .Replace.Path) |
253+
select(.Version == .Replace.Version) |
254+
"-dropreplace \(.Replace.Path)"' |
255+
xargs -L 100 go mod edit -fmt
256+
249257
popd >/dev/null 2>&1
250258
done
251259
echo "=== tidying root" >> "${LOG_FILE}"

staging/src/k8s.io/api/go.mod

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

staging/src/k8s.io/apiextensions-apiserver/go.mod

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

staging/src/k8s.io/apimachinery/go.mod

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

0 commit comments

Comments
 (0)