Commit Graph

15 Commits

Author SHA1 Message Date
Jordan Liggitt
a82d2b9e08
Stop adding explicit replace directives for all requires
This was originally added in the early days of go.mod in order to ensure that the root k8s.io/kubernetes
go.mod file reflected all the versions of dependencies we were using, and to ensure that go commands didn't spuriously
increment these versions.

With module pruning in go1.17+ and go defaulting to mod=readonly mode in go1.16+, this is no longer necessary.
2022-10-28 15:15:18 -04:00
Patrick Ohly
de47d00865 pin-dependency.sh: enhance forking of a dependency
This addresses a problem that occurred when trying the following replacement:
   hack/pin-dependency.sh k8s.io/klog/v2=github.com/pohly/klog/v2 flush-log-sink

That itself worked, but update-vendor.sh then failed:

   === tidying go.mod/go.sum in staging/src/k8s.io/code-generator/examples
  go: k8s.io/apimachinery@v0.0.0 requires
  	k8s.io/klog/v2@v2.4.1-0.20210909144920-0b91caa8c854: invalid version: unknown revision 0b91caa8c854
  go: k8s.io/apimachinery@v0.0.0 requires
  	k8s.io/klog/v2@v2.4.1-0.20210909144920-0b91caa8c854: invalid version: unknown revision 0b91caa8c854
2021-09-14 11:30:17 +02:00
Patrick Ohly
808659cc42 pin-dependencies.sh: support switching repos
Sometimes it is useful to fork a dependency in a different repo and
then use that forked code in Kubernetes. Normally one would do `go mod
edit -replace ...=/local/path` but that has drawbacks:

- repos under staging are not updated
- sharing the modified Kubernetes with others is harder, for example
  in a WIP or RFC PR

The revised pin-dependencies.sh supports this with an optional
=<replacement> part in the dependency parameter.

Determining the revision upfront with `go mod download` also makes the
script simpler.
2021-08-09 16:54:30 +02:00
Jordan Liggitt
2257f46cac [go1.15] fix pin-dependency.sh to only use module info 2020-07-25 16:45:02 -04:00
Jin Hase
e992ec0d59 Add comments in several hack/*.sh 2020-01-28 09:27:40 +09:00
tanjunchen
b2f76cc780 add comment in hack/update-*.sh 2020-01-16 10:05:49 +08:00
Jordan Liggitt
ee2b887c74 Fix hack/pin-dependency.sh for go1.13 2019-11-06 17:39:05 -05:00
Benjamin Elder
1741d9393d fix hack/pin-dependency.sh shellcheck failures 2019-06-24 11:43:04 -07:00
Jordan Liggitt
696eb32d4b Suppress irrelevant jq error message when propagating pinned dependencies 2019-06-10 13:09:12 -04:00
Michael Taufen
ee7bcc53a2 Update klog to v0.3.1
Includes recent fixes, notably https://github.com/kubernetes/klog/pull/66
2019-05-22 10:55:37 -07:00
Jordan Liggitt
77690137a9 propagate pinned versions to staging repos, output cleanup commands 2019-04-15 11:30:07 -04:00
Jordan Liggitt
aaeecd86dc make pin-dependency.sh only work at the module level 2019-04-09 11:45:13 -04:00
Jordan Liggitt
fdd241a858 Mark staging go module files as generated, add script to lint dependencies 2019-04-08 09:42:22 -04:00
Jordan Liggitt
892ad8b449 Make pin-dependency.sh work with things other than docker 2019-04-04 09:20:55 -04:00
Jordan Liggitt
2ea3cbdcbc Update hack scripts to use go mod 2019-04-03 10:19:39 -04:00