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
The makefiles scripts create a variable with all the go files
that are part of the Kubernetes source tree, including staging.
As today, this variable has a size of < 100kb
wc .make/all_go_dirs.mk
2326 2326 98905 .make/all_go_dirs.mk
This variable is passed as argument in the Makefiles, where it
is expanded. In Linux, there is a limit to the max size of
the arguments MAX_ARG_STRLEN.
If the arguments go above 128k, you get a nice:
execvp: /usr/bin/env: Argument list too long
If you, for whatever reason, do some go mod vendor inside the
hack/tools folder, these files will be added to the variable
and most probably you'll go above the limit and get that error.
Then, you'll learn a lot about Makefils, shell expansion, strace,
execpve, ARG_MAX and MAX_ARG_STRLEN,until you realize what is
the real problem :).
Add script to verify that net.ParseIP and net.ParseCIDR are
not being used.
Add another script to automatically replace those functions
for the ones forked in k8s.io/utils/net
The tag extraction from GOFLAGS doesn't do anything if -tags is not
present in GOFLAGS. Not only does that mean non-sensical tags are
passed, but because GOFLAGS is a space-separated variable, the build
will fail because the build flags because -tags must be comma-separated.
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
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.
When building inside a docker container, we fail to pass along enough
information for KUBE_CGO_OVERRIDES. The original PR was geared towards
building the binary from the command line
- dca376a03e
- e4ded2b3ec
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
Removes any reference from the registry gcr.io/kubernetes-e2e-test-images in
kubernetes/kubernetes, replacing it with k8s.gcr.io/kubernetes-e2e-test-images.
In some cases, the images had to be updated since a few things have changed since
their original implementation, most notably being the fact that some of the images
have been centralized into the agnhost image.
Co-Authored-By: Claudiu Belu <cbelu@cloudbasesolutions.com>