Some operations are sensitive to the version of Go that is used. In
the past, formatting of source differed depending on the
version. Right now it is the content of the vendor directory which
changes when switch back and forth between 1.12 and 1.13.
We don't want to impose a certain workflow on developers, like forcing
all invocations of Go to run inside a container. If developers want
that, they can set up their development environment accordingly.
But we should warn about this aspect to raise awareness. "make"
invocations which involve Go now compare against the projects Go
version (specified in travis.yml) once at the beginning. This is only
a warning because we don't know which future version will be
compatible with the project.
Vendor directory handling gets updated, too: verification is now a
separate script (became too complex for make) and there is a
corresponding "update-vendor.sh". In contrast to verification,
updating vendor is not integrated into make and thus itself invokes
the go version check.
It turned out that changes like
https://github.com/kubernetes-csi/csi-lib-utils/pull/33 should better
have been committed after `go mod tidy` because that adds some
indirect dependencies in that example.
The revised `test-vendor` checks for that and (just in case that this
ever becomes desired) allows projects to not have a vendor directory
when using `go mod`.
How to use `go mod` properly gets documented in the README.md, because
there are such pitfalls.
changes to kind. There are 3 changes made to prow.sh:
1. Use a master commit of kind that includes the fix for Kubernetes
master.
2. Use git clone instead of git checkout (shallow) to source Kubernetes.
This lets kind correctly figure out the Kubernetes release tag.
3. Build kind with make install. The kind fix was not working correctly
when built with go build.
with specific patch versions that kind 0.4.0 supports. Also, feature
gate setting is only supported on 1.15+ due to
kind.sigs.k8s.io/v1alpha3 and kubeadm.k8s.io/v1beta2 dependencies.
By moving the code into a separate function, other CSI drivers have a
chance to overwrite it. For the hostpath driver itself we need the
ability to set the driver name depending on which revision is getting
installed.
How a repo does vendoring is detected based on the presence of
Gopkg.toml.
The vendor check with `dep` was all done locally, but the
corresponding check for `go mod` requires network access. The check
therefore gets skipped when running in the Prow CI in situations where
we are sure that it isn't needed (for example, in a periodic job).
Whether a component supports sanity testing depends on the
component. For example, csi-driver-host-path enables it because it
makes sense there (and only there). Letting the prow.sh script decide
whether it actually runs simplifies the job definitions in test-infra.