Skip to content

Commit 45e57bf

Browse files
authored
Merge pull request #23 from wozniakjan/update-release-tools-and-vendor
Update release tools and vendor
2 parents d2347b1 + 8e4ba5d commit 45e57bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+5993
-1660
lines changed

go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ require (
1111
github.com/onsi/ginkgo v1.8.0
1212
github.com/onsi/gomega v1.5.0
1313
github.com/opencontainers/go-digest v1.0.0-rc1 // indirect
14-
github.com/spf13/afero v1.2.2 // indirect
1514
github.com/spf13/cobra v0.0.3
1615
golang.org/x/net v0.0.0-20190415100556-4a65cf94b679
1716
google.golang.org/grpc v1.20.0
@@ -24,5 +23,5 @@ require (
2423
k8s.io/kube-aggregator v0.0.0-20190415133304-80ce4e5a0cbc // indirect
2524
k8s.io/kube-openapi v0.0.0-20190401085232-94e1e7b7574c // indirect
2625
k8s.io/kubernetes v1.14.1
27-
k8s.io/utils v0.0.0-20190308190857-21c4ce38f2a7 // indirect
26+
k8s.io/utils v0.0.0-20200124190032-861946025e34
2827
)

go.sum

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7 h1:u9SHYsPQNyt5t
2626
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
2727
github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea h1:n2Ltr3SrfQlf/9nOna1DoGKxLx3qTSI8Ttl6Xrqp6mw=
2828
github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
29+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
2930
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
3031
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
3132
github.com/dgrijalva/jwt-go v0.0.0-20160705203006-01aeca54ebda h1:NyywMz59neOoVRFDz+ccfKWxn784fiHMDnZSy6T+JXY=
@@ -160,10 +161,13 @@ github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8=
160161
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
161162
github.com/spf13/pflag v1.0.1 h1:aCvUg6QPl3ibpQUxyLkrEkCHtPqYJL4x9AuhqVqFis4=
162163
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
164+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
163165
github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
164166
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
165167
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
166168
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
169+
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
170+
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
167171
github.com/tinylib/msgp v1.1.0 h1:9fQd+ICuRIu/ue4vxJZu6/LzxN0HwMds2nq/0cFvxHU=
168172
github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
169173
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8 h1:ndzgwNDnKIqyCvHTXaCqh9KlOWKvBry6nuXMJmonVsE=
@@ -268,6 +272,8 @@ k8s.io/csi-translation-lib v0.0.0-20190415134207-82f1dfd98d10/go.mod h1:L35fSWHA
268272
k8s.io/gengo v0.0.0-20190116091435-f8a0810f38af/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
269273
k8s.io/klog v0.0.0-20190306015804-8e90cee79f82 h1:SHucoAy7lRb+w5oC/hbXyZg+zX+Wftn6hD4tGzHCVqA=
270274
k8s.io/klog v0.0.0-20190306015804-8e90cee79f82/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
275+
k8s.io/klog v0.3.0 h1:0VPpR+sizsiivjIfIAQH/rl8tan6jvWkS7lU+0di3lE=
276+
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
271277
k8s.io/kube-aggregator v0.0.0-20190415133304-80ce4e5a0cbc h1:My3QUoguktKeT5UYet1WNr9Mw4noRGlCHHsKnGzHsBI=
272278
k8s.io/kube-aggregator v0.0.0-20190415133304-80ce4e5a0cbc/go.mod h1:T/aMpr/6zvgjgJIumGJ+E8XhJCDwJH0hRfExeZJ1IJM=
273279
k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 h1:TRb4wNWoBVrH9plmkp2q86FIDppkbrEXdXlxU3a3BMI=
@@ -277,8 +283,8 @@ k8s.io/kube-openapi v0.0.0-20190401085232-94e1e7b7574c/go.mod h1:BXM9ceUBTj2QnfH
277283
k8s.io/kubernetes v1.14.1 h1:I9F52h5sqVxBmoSsBlNQ0YygNcukDilkpGxUbJRoBoY=
278284
k8s.io/kubernetes v1.14.1/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
279285
k8s.io/utils v0.0.0-20190221042446-c2654d5206da/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0=
280-
k8s.io/utils v0.0.0-20190308190857-21c4ce38f2a7 h1:8r+l4bNWjRlsFYlQJnKJ2p7s1YQPj4XyXiJVqDHRx7c=
281-
k8s.io/utils v0.0.0-20190308190857-21c4ce38f2a7/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0=
286+
k8s.io/utils v0.0.0-20200124190032-861946025e34 h1:HjlUD6M0K3P8nRXmr2B9o4F9dUy9TCj/aEpReeyi6+k=
287+
k8s.io/utils v0.0.0-20200124190032-861946025e34/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
282288
modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw=
283289
modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk=
284290
modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=

pkg/nfs/nfs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package nfs
1919
import (
2020
"github.com/container-storage-interface/spec/lib/go/csi"
2121
"github.com/golang/glog"
22-
"k8s.io/kubernetes/pkg/util/mount"
22+
"k8s.io/utils/mount"
2323
)
2424

2525
type nfsDriver struct {

pkg/nfs/nodeserver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
"golang.org/x/net/context"
2828
"google.golang.org/grpc/codes"
2929
"google.golang.org/grpc/status"
30-
"k8s.io/kubernetes/pkg/util/mount"
30+
"k8s.io/utils/mount"
3131
)
3232

3333
type nodeServer struct {

release-tools/.prow.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#! /bin/bash -e
2+
#
3+
# This is for testing csi-release-tools itself in Prow. All other
4+
# repos use prow.sh for that, but as csi-release-tools isn't a normal
5+
# repo with some Go code in it, it has a custom Prow test script.
6+
7+
./verify-shellcheck.sh "$(pwd)"

release-tools/README.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,118 @@ Cheat sheet:
4949
- `git subtree add --prefix=release-tools https://github.com/kubernetes-csi/csi-release-tools.git master` - add release tools to a repo which does not have them yet (only once)
5050
- `git subtree pull --prefix=release-tools https://github.com/kubernetes-csi/csi-release-tools.git master` - update local copy to latest upstream (whenever upstream changes)
5151
- edit, `git commit`, `git subtree push --prefix=release-tools [email protected]:<user>/csi-release-tools.git <my-new-or-existing-branch>` - push to a new branch before submitting a PR
52+
53+
verify-shellcheck.sh
54+
--------------------
55+
56+
The [verify-shellcheck.sh](./verify-shellcheck.sh) script in this repo
57+
is a stripped down copy of the [corresponding
58+
script](https://github.com/kubernetes/kubernetes/blob/release-1.14/hack/verify-shellcheck.sh)
59+
in the Kubernetes repository. It can be used to check for certain
60+
errors shell scripts, like missing quotation marks. The default
61+
`test-shellcheck` target in [build.make](./build.make) only checks the
62+
scripts in this directory. Components can add more directories to
63+
`TEST_SHELLCHECK_DIRS` to check also other scripts.
64+
65+
End-to-end testing
66+
------------------
67+
68+
A repo that wants to opt into testing via Prow must set up a top-level
69+
`.prow.sh`. Typically that will source `prow.sh` and then transfer
70+
control to it:
71+
72+
``` bash
73+
#! /bin/bash -e
74+
75+
. release-tools/prow.sh
76+
main
77+
```
78+
79+
All Kubernetes-CSI repos are expected to switch to Prow. For details
80+
on what is enabled in Prow, see
81+
https://github.com/kubernetes/test-infra/tree/master/config/jobs/kubernetes-csi
82+
83+
Test results for periodic jobs are visible in
84+
https://testgrid.k8s.io/sig-storage-csi-ci
85+
86+
It is possible to reproduce the Prow testing locally on a suitable machine:
87+
- Linux host
88+
- Docker installed
89+
- code to be tested checkout out in `$GOPATH/src/<import path>`
90+
- `cd $GOPATH/src/<import path> && ./.prow.sh`
91+
92+
Beware that the script intentionally doesn't clean up after itself and
93+
modifies the content of `$GOPATH`, in particular the `kubernetes` and
94+
`kind` repositories there. Better run it in an empty, disposable
95+
`$GOPATH`.
96+
97+
When it terminates, the following command can be used to get access to
98+
the Kubernetes cluster that was brought up for testing (assuming that
99+
this step succeeded):
100+
101+
export KUBECONFIG="$(kind get kubeconfig-path --name="csi-prow")"
102+
103+
It is possible to control the execution via environment variables. See
104+
`prow.sh` for details. Particularly useful is testing against different
105+
Kubernetes releases:
106+
107+
CSI_PROW_KUBERNETES_VERSION=1.13.3 ./.prow.sh
108+
CSI_PROW_KUBERNETES_VERSION=latest ./.prow.sh
109+
110+
Dependencies and vendoring
111+
--------------------------
112+
113+
Most projects will (eventually) use `go mod` to manage
114+
dependencies. `dep` is also still supported by `csi-release-tools`,
115+
but not documented here because it's not recommended anymore.
116+
117+
The usual instructions for using [go
118+
modules](https://github.com/golang/go/wiki/Modules) apply. Here's a cheat sheet
119+
for some of the relevant commands:
120+
- list available updates: `GO111MODULE=on go list -u -m all`
121+
- update or add a single dependency: `GO111MODULE=on go get <package>`
122+
- update all dependencies to their next minor or patch release:
123+
`GO111MODULE=on go get ./...` (add `-u=patch` to limit to patch
124+
releases)
125+
- lock onto a specific version: `GO111MODULE=on go get <package>@<version>`
126+
- clean up `go.mod`: `GO111MODULE=on go mod tidy`
127+
- update vendor directory: `GO111MODULE=on go mod vendor`
128+
129+
`GO111MODULE=on` can be left out when using Go >= 1.13 or when the
130+
source is checked out outside of `$GOPATH`.
131+
132+
`go mod tidy` must be used to ensure that the listed dependencies are
133+
really still needed. Changing import statements or a tentative `go
134+
get` can result in stale dependencies.
135+
136+
The `test-vendor` verifies that it was used when run locally or in a
137+
pre-merge CI job. If a `vendor` directory is present, it will also
138+
verify that it's content is up-to-date.
139+
140+
The `vendor` directory is optional. It is still present in projects
141+
because it avoids downloading sources during CI builds. If this is no
142+
longer deemed necessary, then a project can also remove the directory.
143+
144+
Conversion of a repository that uses `dep` to `go mod` can be done with:
145+
146+
GO111MODULE=on go mod init
147+
release-tools/go-get-kubernetes.sh <current Kubernetes version from Gopkg.toml>
148+
GO111MODULE=on go mod tidy
149+
GO111MODULE=on go mod vendor
150+
git rm -f Gopkg.toml Gopkg.lock
151+
git add go.mod go.sum vendor
152+
153+
### Updating Kubernetes dependencies
154+
155+
When using packages that are part of the Kubernetes source code, the
156+
commands above are not enough because the [lack of semantic
157+
versioning](https://github.com/kubernetes/kubernetes/issues/72638)
158+
prevents `go mod` from finding newer releases. Importing directly from
159+
`kubernetes/kubernetes` also needs `replace` statements to override
160+
the fake `v0.0.0` versions
161+
(https://github.com/kubernetes/kubernetes/issues/79384). The
162+
`go-get-kubernetes.sh` script can be used to update all packages in
163+
lockstep to a different Kubernetes version. Example usage:
164+
```
165+
$ ./release-tools/go-get-kubernetes.sh 1.16.4
166+
```
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Sidecar Release Process
2+
3+
This page describes the process for releasing a kubernetes-csi sidecar.
4+
5+
## Prerequisites
6+
7+
The release manager must:
8+
9+
* Be a member of the kubernetes-csi organization. Open an
10+
[issue](https://github.com/kubernetes/org/issues/new?assignees=&labels=area%2Fgithub-membership&template=membership.md&title=REQUEST%3A+New+membership+for+%3Cyour-GH-handle%3E) in
11+
kubernetes/org to request membership
12+
* Be a top level approver for the repository. To become a top level approver,
13+
the candidate must demonstrate ownership and deep knowledge of the repository
14+
through active maintainence, responding to and fixing issues, reviewing PRs,
15+
test triage.
16+
* Be part of the maintainers or admin group for the repository. admin is a
17+
superset of maintainers, only maintainers level is required for cutting a
18+
release. Membership can be requested by submitting a PR to kubernetes/org.
19+
[Example](https://github.com/kubernetes/org/pull/1467)
20+
21+
## Updating CI Jobs
22+
Whenever a new Kubernetes minor version is released, our kubernetes-csi CI jobs
23+
must be updated.
24+
25+
[Our CI jobs](https://k8s-testgrid.appspot.com/sig-storage-csi-ci) have the
26+
naming convention `<hostpath-deployment-version>-on-<kubernetes-version>`.
27+
28+
1. Jobs should be actively monitored to find and fix failures in sidecars and
29+
infrastructure changes early in the development cycle. Test failures are sent
30+
31+
1. "-on-master" jobs are the closest reflection to the new Kubernetes version.
32+
1. Fixes to our prow.sh CI script can be tested in the [CSI hostpath
33+
repo](https://github.com/kubernetes-csi/csi-driver-host-path) by modifying
34+
[prow.sh](https://github.com/kubernetes-csi/csi-driver-host-path/blob/master/release-tools/prow.sh)
35+
along with any overrides in
36+
[.prow.sh](https://github.com/kubernetes-csi/csi-driver-host-path/blob/master/.prow.sh)
37+
to mirror the failing environment. Once e2e tests are passing (verify-unit tests
38+
will fail), then the prow.sh changes can be submitted to [csi-release-tools](https://github.com/kubernetes-csi/csi-release-tools).
39+
1. Changes can then be updated in all the sidecar repos and hostpath driver repo
40+
by following the [update
41+
instructions](https://github.com/kubernetes-csi/csi-release-tools/blob/master/README.md#sharing-and-updating).
42+
1. New pull and CI jobs are configured by
43+
[gen-jobs.sh](https://github.com/kubernetes/test-infra/blob/master/config/jobs/kubernetes-csi/gen-jobs.sh).
44+
New pull jobs that have been unverified should be initially made optional.
45+
[Example](https://github.com/kubernetes/test-infra/pull/15055)
46+
1. Once new pull and CI jobs have been verified, and the new Kubernetes version
47+
is released, we can make the optional jobs required, and also remove the
48+
Kubernetes versions that are no longer supported.
49+
50+
## Release Process
51+
1. Identify all issues and ongoing PRs that should go into the release, and
52+
drive them to resolution.
53+
1. Download [K8s release notes
54+
generator](https://github.com/kubernetes/release/tree/master/cmd/release-notes)
55+
1. Generate release notes for the release. Replace arguments with the relevant
56+
information.
57+
```
58+
GITHUB_TOKEN=<token> ./release-notes --start-sha=0ed6978fd199e3ca10326b82b4b8b8e916211c9b --end-sha=3cb3d2f18ed8cb40371c6d8886edcabd1f27e7b9 \
59+
--github-org=kubernetes-csi --github-repo=external-attacher -branch=master -output out.md
60+
```
61+
* `--start-sha` should point to the last release from the same branch. For
62+
example:
63+
* `1.X-1.0` tag when releasing `1.X.0`
64+
* `1.X.Y-1` tag when releasing `1.X.Y`
65+
1. Compare the generated output to the new commits for the release to check if
66+
any notable change missed a release note.
67+
1. Reword release notes as needed. Make sure to check notes for breaking
68+
changes and deprecations.
69+
1. If release is a new major/minor version, create a new `CHANGELOG-<major>.<minor>.md`
70+
file. Otherwise, add the release notes to the top of the existing CHANGELOG
71+
file for that minor version.
72+
1. Submit a PR for the CHANGELOG changes.
73+
1. Submit a PR for README changes, in particular, Compatibility, Feature status,
74+
and any other sections that may need updating.
75+
1. Check that all [canary CI
76+
jobs](https://k8s-testgrid.appspot.com/sig-storage-csi-ci) are passing,
77+
and that test coverage is adequate for the changes that are going into the release.
78+
1. Make sure that no new PRs have merged in the meantime, and no PRs are in
79+
flight and soon to be merged.
80+
1. Create a new release following a previous release as a template. Be sure to select the correct
81+
branch. This requires Github release permissions as required by the prerequisites.
82+
[external-provisioner example](https://github.com/kubernetes-csi/external-provisioner/releases/new)
83+
1. If release was a new major/minor version, create a new `release-<minor>`
84+
branch at that commit.
85+
1. Update [kubernetes-csi/docs](https://github.com/kubernetes-csi/docs) sidecar
86+
and feature pages with the new released version.
87+
1. After all the sidecars have been released, update
88+
CSI hostpath driver with the new sidecars in the [CSI repo](https://github.com/kubernetes-csi/csi-driver-host-path/tree/master/deploy)
89+
and [k/k
90+
in-tree](https://github.com/kubernetes/kubernetes/tree/master/test/e2e/testing-manifests/storage-csi/hostpath/hostpath)

0 commit comments

Comments
 (0)