mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #91617 from jqmichael/vendorMd
Added link to vendor.md in go.mod
This commit is contained in:
commit
ae2422ae15
2
go.mod
2
go.mod
@ -1,4 +1,6 @@
|
|||||||
// This is a generated file. Do not edit directly.
|
// This is a generated file. Do not edit directly.
|
||||||
|
// Ensure you've carefully read
|
||||||
|
// https://git.k8s.io/community/contributors/devel/sig-architecture/vendor.md
|
||||||
// Run hack/pin-dependency.sh to change pinned dependency versions.
|
// Run hack/pin-dependency.sh to change pinned dependency versions.
|
||||||
// Run hack/update-vendor.sh to update go.mod files and the vendor directory.
|
// Run hack/update-vendor.sh to update go.mod files and the vendor directory.
|
||||||
|
|
||||||
|
@ -99,10 +99,10 @@ function group_replace_directives() {
|
|||||||
/^replace [(]/ { inreplace=1; next }
|
/^replace [(]/ { inreplace=1; next }
|
||||||
inreplace && /^[)]/ { inreplace=0; next }
|
inreplace && /^[)]/ { inreplace=0; next }
|
||||||
inreplace { print > \"${go_mod_replace}\"; next }
|
inreplace { print > \"${go_mod_replace}\"; next }
|
||||||
|
|
||||||
# print ungrouped replace directives with the replace directive trimmed
|
# print ungrouped replace directives with the replace directive trimmed
|
||||||
/^replace [^(]/ { sub(/^replace /,\"\"); print > \"${go_mod_replace}\"; next }
|
/^replace [^(]/ { sub(/^replace /,\"\"); print > \"${go_mod_replace}\"; next }
|
||||||
|
|
||||||
# otherwise print to the noreplace file
|
# otherwise print to the noreplace file
|
||||||
{ print > \"${go_mod_noreplace}\" }
|
{ print > \"${go_mod_noreplace}\" }
|
||||||
" < go.mod
|
" < go.mod
|
||||||
@ -136,7 +136,7 @@ function add_generated_comments() {
|
|||||||
echo ""
|
echo ""
|
||||||
cat "${go_mod_nocomments}"
|
cat "${go_mod_nocomments}"
|
||||||
} > go.mod
|
} > go.mod
|
||||||
|
|
||||||
# Format
|
# Format
|
||||||
go mod edit -fmt
|
go mod edit -fmt
|
||||||
}
|
}
|
||||||
@ -232,7 +232,7 @@ while IFS= read -r repo; do
|
|||||||
go list -tags=tools all
|
go list -tags=tools all
|
||||||
} >> "${LOG_FILE}" 2>&1
|
} >> "${LOG_FILE}" 2>&1
|
||||||
|
|
||||||
# capture module dependencies
|
# capture module dependencies
|
||||||
go list -m -f '{{if not .Main}}{{.Path}}{{end}}' all > "${tmp_go_deps}"
|
go list -m -f '{{if not .Main}}{{.Path}}{{end}}' all > "${tmp_go_deps}"
|
||||||
|
|
||||||
# restore the original go.mod file
|
# restore the original go.mod file
|
||||||
@ -255,13 +255,13 @@ for repo in $(tsort "${TMP_DIR}/tidy_deps.txt"); do
|
|||||||
|
|
||||||
# prune replace directives that pin to the naturally selected version.
|
# prune replace directives that pin to the naturally selected version.
|
||||||
# do this before tidying, since tidy removes unused modules that
|
# do this before tidying, since tidy removes unused modules that
|
||||||
# don't provide any relevant packages, which forgets which version of the
|
# don't provide any relevant packages, which forgets which version of the
|
||||||
# unused transitive dependency we had a require directive for,
|
# unused transitive dependency we had a require directive for,
|
||||||
# and prevents pruning the matching replace directive after tidying.
|
# and prevents pruning the matching replace directive after tidying.
|
||||||
go list -m -json all |
|
go list -m -json all |
|
||||||
jq -r 'select(.Replace != null) |
|
jq -r 'select(.Replace != null) |
|
||||||
select(.Path == .Replace.Path) |
|
select(.Path == .Replace.Path) |
|
||||||
select(.Version == .Replace.Version) |
|
select(.Version == .Replace.Version) |
|
||||||
"-dropreplace \(.Replace.Path)"' |
|
"-dropreplace \(.Replace.Path)"' |
|
||||||
xargs -L 100 go mod edit -fmt
|
xargs -L 100 go mod edit -fmt
|
||||||
|
|
||||||
@ -285,9 +285,9 @@ $(go mod why "${loopback_deps[@]}")"
|
|||||||
|
|
||||||
# prune replace directives that pin to the naturally selected version
|
# prune replace directives that pin to the naturally selected version
|
||||||
go list -m -json all |
|
go list -m -json all |
|
||||||
jq -r 'select(.Replace != null) |
|
jq -r 'select(.Replace != null) |
|
||||||
select(.Path == .Replace.Path) |
|
select(.Path == .Replace.Path) |
|
||||||
select(.Version == .Replace.Version) |
|
select(.Version == .Replace.Version) |
|
||||||
"-dropreplace \(.Replace.Path)"' |
|
"-dropreplace \(.Replace.Path)"' |
|
||||||
xargs -L 100 go mod edit -fmt
|
xargs -L 100 go mod edit -fmt
|
||||||
|
|
||||||
@ -309,6 +309,8 @@ fi
|
|||||||
kube::log::status "go.mod: adding generated comments"
|
kube::log::status "go.mod: adding generated comments"
|
||||||
add_generated_comments "
|
add_generated_comments "
|
||||||
// This is a generated file. Do not edit directly.
|
// This is a generated file. Do not edit directly.
|
||||||
|
// Ensure you've carefully read
|
||||||
|
// https://git.k8s.io/community/contributors/devel/sig-architecture/vendor.md
|
||||||
// Run hack/pin-dependency.sh to change pinned dependency versions.
|
// Run hack/pin-dependency.sh to change pinned dependency versions.
|
||||||
// Run hack/update-vendor.sh to update go.mod files and the vendor directory.
|
// Run hack/update-vendor.sh to update go.mod files and the vendor directory.
|
||||||
"
|
"
|
||||||
|
Loading…
Reference in New Issue
Block a user