While switching back and forth between release-1.13 and release-1.14
locally, there was the problem that the local kind image kept using
the wrong kubelet binary despite rebuilding from source. The problem
went away after cleaning the Bazel cache. Exact root cause unknown,
but perhaps using unique tags and properly cleaning the repo helps.
If not, then the unique tags at least will show what the problem is.
Using the same (recent) Go version for all Kubernetes versions can
break for older versions when there are incompatible changes in Go. To
avoid that, we use exactly the minimum version of Go required for each
Kubernetes version. This is based on the assumption that this
combination was tested successfully.
When building the E2E suite from Kubernetes (the default) we do the
same, but still allow building it from elsewhere.
We allow the Go version to be empty when it doesn't matter.
This enables testing of other repos and of this repo itself inside
Prow. Currently supported is unit testing ("make test") and E2E
testing (either via a local test suite or the Kubernetes E2E test
suite applied to the hostpath driver example deployment).
The script passes shellcheck and uses Prow to verify that for future
PRs.
By default this only tests the scripts inside the "release-tools"
directory, which is useful when making experimental changes to them in
a component that uses csi-release-tools. But a component can also
enable checking for other directories.
These are the modifications that were necessary to call this outside
of Kubernetes. The support for excluding files from checking gets
removed to simplify the script. It shouldn't be needed, because
linting can be enabled after fixing whatever scripts might fail the
check.
If for whatever reasons a repo already had a `release-tools` directory
before doing a clean import of it with `git subtree`, the check used
to fail because it found those old commits.
This can be fixed by telling `git log` to stop when the directory
disappears from the repo. There has to be a commit with removes the
old content, because otherwise `git subtree add` doesn't work.
Fixes: https://github.com/kubernetes-csi/external-resizer/issues/21
The introduction for each individual test looked like an actual
command:
test-subtree
./release-tools/verify-subtree.sh release-tools
Directory 'release-tools' contains non-upstream changes:
...
It's better to make it look like a shell comment and increase its
visibility with a longer prefix:
### test-subtree:
./release-tools/verify-subtree.sh release-tools
...
Maintaining a list of all the temp files used by various editors and
IDEs is cumbersome. Instead of doing that in each repo, developers
contributing to kubernetes-csi should set up a global .gitignore for
their own tools.
This synchronizes the build rules with other repos and (as part of
that) bumps the Go version to 1.11.1. The recommended formatting
changed slightly in that Go version.
Individual repos may have to filter out certain packages from
testing. For example, in csi-test the cmd/csi-sanity directory
contains a special test that depends on additional parameters that set
the CSI driver to test against.