Skip to content

Commit 783ee65

Browse files
committed
Merge commit '9259807b2334ff469d3018da685e5c91fa30faa8' into prow-update-release-1.2
2 parents 45b15b7 + bbd32f6 commit 783ee65

12 files changed

+354
-122
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md
2+
3+
aliases:
4+
5+
# SIG-Storage chairs and leads should always have approval rights in all repos.
6+
# Others may be added as needed here or in each repo.
7+
kubernetes-csi-approvers:
8+
- jsafrane
9+
- msau42
10+
- saad-ali
11+
- xing-yang
12+
13+
# Reviewers are automatically assigned to new PRs. The following
14+
# reviewers will be active in all repos. Other reviewers can be
15+
# added in each repo.
16+
#
17+
# Reviewers are encouraged to set the "Busy" flag in their GitHub status
18+
# when they are temporarily unable to review PRs.
19+
kubernetes-csi-reviewers:
20+
- andyzhangx
21+
- chrishenzie
22+
- ggriffiths
23+
- gnufied
24+
- humblec
25+
- j-griffith
26+
- Jiawei0227
27+
- jingxu97
28+
- jsafrane
29+
- pohly
30+
- xing-yang
31+
32+
# This documents who previously contributed to Kubernetes-CSI
33+
# as approver.
34+
emeritus_approver:
35+
- lpabon
36+
- sbezverk
37+
- vladimirvivien
38+
39+
# This documents who previously contributed to Kubernetes-CSI
40+
# as reviewer.
41+
emeritus_reviewer:
42+
- lpabon
43+
- saad-ali
44+
- sbezverk
45+
- vladimirvivien

release-tools/OWNERS

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md
22

33
approvers:
4-
- saad-ali
5-
- msau42
4+
- kubernetes-csi-approvers
65
- pohly
76

87
reviewers:
9-
- saad-ali
10-
- msau42
11-
- pohly
8+
- kubernetes-csi-reviewers

release-tools/OWNERS_ALIASES

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
KUBERNETES_CSI_OWNERS_ALIASES

release-tools/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ images. Building from master creates the main `canary` image.
4242
Sharing and updating
4343
--------------------
4444

45-
[`git subtree`](https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt)
45+
[`git subtree`](https://github.com/git/git/blob/HEAD/contrib/subtree/git-subtree.txt)
4646
is the recommended way of maintaining a copy of the rules inside the
4747
`release-tools` directory of a project. This way, it is possible to make
4848
changes also locally, test them and then push them back to the shared
@@ -89,7 +89,7 @@ main
8989

9090
All Kubernetes-CSI repos are expected to switch to Prow. For details
9191
on what is enabled in Prow, see
92-
https://github.com/kubernetes/test-infra/tree/master/config/jobs/kubernetes-csi
92+
https://github.com/kubernetes/test-infra/tree/HEAD/config/jobs/kubernetes-csi
9393

9494
Test results for periodic jobs are visible in
9595
https://testgrid.k8s.io/sig-storage-csi-ci

release-tools/SECURITY_CONTACTS

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# to for triaging and handling of incoming issues.
55
#
66
# The below names agree to abide by the
7-
# [Embargo Policy](https://github.com/kubernetes/sig-release/blob/master/security-release-process-documentation/security-release-process.md#embargo-policy)
7+
# [Embargo Policy](https://github.com/kubernetes/sig-release/blob/HEAD/security-release-process-documentation/security-release-process.md#embargo-policy)
88
# and will be removed and replaced if they violate that agreement.
99
#
1010
# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE

release-tools/SIDECAR_RELEASE_PROCESS.md

+11-16
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,8 @@ The release manager must:
99
* Be a member of the kubernetes-csi organization. Open an
1010
[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
1111
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 maintenance, 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.
12+
* Be part of the maintainers group for the repository.
13+
Membership can be requested by submitting a PR to kubernetes/org.
1914
[Example](https://github.com/kubernetes/org/pull/1467)
2015

2116
## Updating CI Jobs
@@ -31,16 +26,16 @@ naming convention `<hostpath-deployment-version>-on-<kubernetes-version>`.
3126
1. "-on-master" jobs are the closest reflection to the new Kubernetes version.
3227
1. Fixes to our prow.sh CI script can be tested in the [CSI hostpath
3328
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)
29+
[prow.sh](https://github.com/kubernetes-csi/csi-driver-host-path/blob/HEAD/release-tools/prow.sh)
3530
along with any overrides in
36-
[.prow.sh](https://github.com/kubernetes-csi/csi-driver-host-path/blob/master/.prow.sh)
31+
[.prow.sh](https://github.com/kubernetes-csi/csi-driver-host-path/blob/HEAD/.prow.sh)
3732
to mirror the failing environment. Once e2e tests are passing (verify-unit tests
3833
will fail), then the prow.sh changes can be submitted to [csi-release-tools](https://github.com/kubernetes-csi/csi-release-tools).
3934
1. Changes can then be updated in all the sidecar repos and hostpath driver repo
4035
by following the [update
41-
instructions](https://github.com/kubernetes-csi/csi-release-tools/blob/master/README.md#sharing-and-updating).
36+
instructions](https://github.com/kubernetes-csi/csi-release-tools/blob/HEAD/README.md#sharing-and-updating).
4237
1. New pull and CI jobs are configured by adding new K8s versions to the top of
43-
[gen-jobs.sh](https://github.com/kubernetes/test-infra/blob/master/config/jobs/kubernetes-csi/gen-jobs.sh).
38+
[gen-jobs.sh](https://github.com/kubernetes/test-infra/blob/HEAD/config/jobs/kubernetes-csi/gen-jobs.sh).
4439
New pull jobs that have been unverified should be initially made optional by
4540
setting the new K8s version as
4641
[experimental](https://github.com/kubernetes/test-infra/blob/a1858f46d6014480b130789df58b230a49203a64/config/jobs/kubernetes-csi/gen-jobs.sh#L40).
@@ -52,7 +47,7 @@ naming convention `<hostpath-deployment-version>-on-<kubernetes-version>`.
5247
1. Identify all issues and ongoing PRs that should go into the release, and
5348
drive them to resolution.
5449
1. Download v2.8+ [K8s release notes
55-
generator](https://github.com/kubernetes/release/tree/master/cmd/release-notes)
50+
generator](https://github.com/kubernetes/release/tree/HEAD/cmd/release-notes)
5651
1. Generate release notes for the release. Replace arguments with the relevant
5752
information.
5853
* Clean up old cached information (also needed if you are generating release
@@ -95,15 +90,15 @@ naming convention `<hostpath-deployment-version>-on-<kubernetes-version>`.
9590
1. Check [image build status](https://k8s-testgrid.appspot.com/sig-storage-image-build).
9691
1. Promote images from k8s-staging-sig-storage to k8s.gcr.io/sig-storage. From
9792
the [k8s image
98-
repo](https://github.com/kubernetes/k8s.io/tree/master/k8s.gcr.io/images/k8s-staging-sig-storage),
93+
repo](https://github.com/kubernetes/k8s.io/tree/HEAD/k8s.gcr.io/images/k8s-staging-sig-storage),
9994
run `./generate.sh > images.yaml`, and send a PR with the updated images.
10095
Once merged, the image promoter will copy the images from staging to prod.
10196
1. Update [kubernetes-csi/docs](https://github.com/kubernetes-csi/docs) sidecar
10297
and feature pages with the new released version.
10398
1. After all the sidecars have been released, update
104-
CSI hostpath driver with the new sidecars in the [CSI repo](https://github.com/kubernetes-csi/csi-driver-host-path/tree/master/deploy)
99+
CSI hostpath driver with the new sidecars in the [CSI repo](https://github.com/kubernetes-csi/csi-driver-host-path/tree/HEAD/deploy)
105100
and [k/k
106-
in-tree](https://github.com/kubernetes/kubernetes/tree/master/test/e2e/testing-manifests/storage-csi/hostpath/hostpath)
101+
in-tree](https://github.com/kubernetes/kubernetes/tree/HEAD/test/e2e/testing-manifests/storage-csi/hostpath/hostpath)
107102

108103
## Adding support for a new Kubernetes release
109104

@@ -134,7 +129,7 @@ naming convention `<hostpath-deployment-version>-on-<kubernetes-version>`.
134129
1. Once all sidecars for the new Kubernetes release are released,
135130
either bump the version number of the images in the existing
136131
[csi-driver-host-path
137-
deployments](https://github.com/kubernetes-csi/csi-driver-host-path/tree/master/deploy)
132+
deployments](https://github.com/kubernetes-csi/csi-driver-host-path/tree/HEAD/deploy)
138133
and/or create a new deployment, depending on what Kubernetes
139134
release an updated sidecar is compatible with. If no new deployment
140135
is needed, then add a symlink to document that there intentionally

release-tools/build.make

+47-16
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,19 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
# force the usage of /bin/bash instead of /bin/sh
16+
SHELL := /bin/bash
17+
1518
.PHONY: build-% build container-% container push-% push clean test
1619

1720
# A space-separated list of all commands in the repository, must be
1821
# set in main Makefile of a repository.
1922
# CMDS=
2023

24+
# Normally, commands are expected in "cmd". That can be changed for a
25+
# repository to something else by setting CMDS_DIR before including build.make.
26+
CMDS_DIR ?= cmd
27+
2128
# This is the default. It can be overridden in the main Makefile after
2229
# including build.make.
2330
REGISTRY_NAME?=quay.io/k8scsi
@@ -63,30 +70,39 @@ endif
6370
# Specific packages can be excluded from each of the tests below by setting the *_FILTER_CMD variables
6471
# to something like "| grep -v 'github.com/kubernetes-csi/project/pkg/foobar'". See usage below.
6572

66-
# BUILD_PLATFORMS contains a set of <os> <arch> <suffix> triplets,
73+
# BUILD_PLATFORMS contains a set of tuples [os arch suffix base_image addon_image]
6774
# separated by semicolon. An empty variable or empty entry (= just a
6875
# semicolon) builds for the default platform of the current Go
6976
# toolchain.
7077
BUILD_PLATFORMS =
7178

7279
# Add go ldflags using LDFLAGS at the time of compilation.
73-
IMPORTPATH_LDFLAGS = -X main.version=$(REV)
80+
IMPORTPATH_LDFLAGS = -X main.version=$(REV)
7481
EXT_LDFLAGS = -extldflags "-static"
75-
LDFLAGS =
82+
LDFLAGS =
7683
FULL_LDFLAGS = $(LDFLAGS) $(IMPORTPATH_LDFLAGS) $(EXT_LDFLAGS)
7784
# This builds each command (= the sub-directories of ./cmd) for the target platform(s)
7885
# defined by BUILD_PLATFORMS.
7986
$(CMDS:%=build-%): build-%: check-go-version-go
8087
mkdir -p bin
81-
echo '$(BUILD_PLATFORMS)' | tr ';' '\n' | while read -r os arch suffix; do \
82-
if ! (set -x; CGO_ENABLED=0 GOOS="$$os" GOARCH="$$arch" go build $(GOFLAGS_VENDOR) -a -ldflags '$(FULL_LDFLAGS)' -o "./bin/$*$$suffix" ./cmd/$*); then \
88+
# os_arch_seen captures all of the $$os-$$arch seen for the current binary
89+
# that we want to build, if we've seen an $$os-$$arch before it means that
90+
# we don't need to build it again, this is done to avoid building
91+
# the windows binary multiple times (see the default value of $$BUILD_PLATFORMS)
92+
export os_arch_seen="" && echo '$(BUILD_PLATFORMS)' | tr ';' '\n' | while read -r os arch suffix base_image addon_image; do \
93+
os_arch_seen_pre=$${os_arch_seen%%$$os-$$arch*}; \
94+
if ! [ $${#os_arch_seen_pre} = $${#os_arch_seen} ]; then \
95+
continue; \
96+
fi; \
97+
if ! (set -x; cd ./$(CMDS_DIR)/$* && CGO_ENABLED=0 GOOS="$$os" GOARCH="$$arch" go build $(GOFLAGS_VENDOR) -a -ldflags '$(FULL_LDFLAGS)' -o "$(abspath ./bin)/$*$$suffix" .); then \
8398
echo "Building $* for GOOS=$$os GOARCH=$$arch failed, see error(s) above."; \
8499
exit 1; \
85100
fi; \
101+
os_arch_seen+=";$$os-$$arch"; \
86102
done
87103

88104
$(CMDS:%=container-%): container-%: build-%
89-
docker build -t $*:latest -f $(shell if [ -e ./cmd/$*/Dockerfile ]; then echo ./cmd/$*/Dockerfile; else echo Dockerfile; fi) --label revision=$(REV) .
105+
docker build -t $*:latest -f $(shell if [ -e ./$(CMDS_DIR)/$*/Dockerfile ]; then echo ./$(CMDS_DIR)/$*/Dockerfile; else echo Dockerfile; fi) --label revision=$(REV) .
90106

91107
$(CMDS:%=push-%): push-%: container-%
92108
set -ex; \
@@ -121,7 +137,7 @@ DOCKER_BUILDX_CREATE_ARGS ?=
121137
# This target builds a multiarch image for one command using Moby BuildKit builder toolkit.
122138
# Docker Buildx is included in Docker 19.03.
123139
#
124-
# ./cmd/<command>/Dockerfile[.Windows] is used if found, otherwise Dockerfile[.Windows].
140+
# ./$(CMDS_DIR)/<command>/Dockerfile[.Windows] is used if found, otherwise Dockerfile[.Windows].
125141
# It is currently optional: if no such file exists, Windows images are not included,
126142
# even when Windows is listed in BUILD_PLATFORMS. That way, projects can test that
127143
# Windows binaries can be built before adding a Dockerfile for it.
@@ -131,30 +147,46 @@ DOCKER_BUILDX_CREATE_ARGS ?=
131147
# the tag for the resulting multiarch image.
132148
$(CMDS:%=push-multiarch-%): push-multiarch-%: check-pull-base-ref build-%
133149
set -ex; \
134-
DOCKER_CLI_EXPERIMENTAL=enabled; \
135-
export DOCKER_CLI_EXPERIMENTAL; \
150+
export DOCKER_CLI_EXPERIMENTAL=enabled; \
136151
docker buildx create $(DOCKER_BUILDX_CREATE_ARGS) --use --name multiarchimage-buildertest; \
137152
trap "docker buildx rm multiarchimage-buildertest" EXIT; \
138-
dockerfile_linux=$$(if [ -e ./cmd/$*/Dockerfile ]; then echo ./cmd/$*/Dockerfile; else echo Dockerfile; fi); \
139-
dockerfile_windows=$$(if [ -e ./cmd/$*/Dockerfile.Windows ]; then echo ./cmd/$*/Dockerfile.Windows; else echo Dockerfile.Windows; fi); \
153+
dockerfile_linux=$$(if [ -e ./$(CMDS_DIR)/$*/Dockerfile ]; then echo ./$(CMDS_DIR)/$*/Dockerfile; else echo Dockerfile; fi); \
154+
dockerfile_windows=$$(if [ -e ./$(CMDS_DIR)/$*/Dockerfile.Windows ]; then echo ./$(CMDS_DIR)/$*/Dockerfile.Windows; else echo Dockerfile.Windows; fi); \
140155
if [ '$(BUILD_PLATFORMS)' ]; then build_platforms='$(BUILD_PLATFORMS)'; else build_platforms="linux amd64"; fi; \
141156
if ! [ -f "$$dockerfile_windows" ]; then \
142-
build_platforms="$$(echo "$$build_platforms" | sed -e 's/windows *[^ ]* *.exe//g' -e 's/; *;/;/g')"; \
157+
build_platforms="$$(echo "$$build_platforms" | sed -e 's/windows *[^ ]* *.exe *[^ ]* *[^ ]*//g' -e 's/; *;/;/g' -e 's/;[ ]*$$//')"; \
143158
fi; \
144159
pushMultiArch () { \
145160
tag=$$1; \
146-
echo "$$build_platforms" | tr ';' '\n' | while read -r os arch suffix; do \
161+
echo "$$build_platforms" | tr ';' '\n' | while read -r os arch suffix base_image addon_image; do \
162+
escaped_base_image=$${base_image/:/-}; \
163+
if ! [ -z $$escaped_base_image ]; then escaped_base_image+="-"; fi; \
147164
docker buildx build --push \
148-
--tag $(IMAGE_NAME):$$arch-$$os-$$tag \
165+
--tag $(IMAGE_NAME):$$arch-$$os-$$escaped_base_image$$tag \
149166
--platform=$$os/$$arch \
150167
--file $$(eval echo \$${dockerfile_$$os}) \
151168
--build-arg binary=./bin/$*$$suffix \
152169
--build-arg ARCH=$$arch \
170+
--build-arg BASE_IMAGE=$$base_image \
171+
--build-arg ADDON_IMAGE=$$addon_image \
153172
--label revision=$(REV) \
154173
.; \
155174
done; \
156-
images=$$(echo "$$build_platforms" | tr ';' '\n' | while read -r os arch suffix; do echo $(IMAGE_NAME):$$arch-$$os-$$tag; done); \
175+
images=$$(echo "$$build_platforms" | tr ';' '\n' | while read -r os arch suffix base_image addon_image; do \
176+
escaped_base_image=$${base_image/:/-}; \
177+
if ! [ -z $$escaped_base_image ]; then escaped_base_image+="-"; fi; \
178+
echo $(IMAGE_NAME):$$arch-$$os-$$escaped_base_image$$tag; \
179+
done); \
157180
docker manifest create --amend $(IMAGE_NAME):$$tag $$images; \
181+
echo "$$build_platforms" | tr ';' '\n' | while read -r os arch suffix base_image addon_image; do \
182+
if [ $$os = "windows" ]; then \
183+
escaped_base_image=$${base_image/:/-}; \
184+
if ! [ -z $$escaped_base_image ]; then escaped_base_image+="-"; fi; \
185+
image=$(IMAGE_NAME):$$arch-$$os-$$escaped_base_image$$tag; \
186+
os_version=$$(docker manifest inspect mcr.microsoft.com/windows/$${base_image} | grep "os.version" | head -n 1 | awk '{print $$2}' | sed -e 's/"//g') || true; \
187+
docker manifest annotate --os-version $$os_version $(IMAGE_NAME):$$tag $$image; \
188+
fi; \
189+
done; \
158190
docker manifest push -p $(IMAGE_NAME):$$tag; \
159191
}; \
160192
if [ $(PULL_BASE_REF) = "master" ]; then \
@@ -288,4 +320,3 @@ test-spelling:
288320
test-boilerplate:
289321
@ echo; echo "### $@:"
290322
@ ./release-tools/verify-boilerplate.sh "$(pwd)"
291-

release-tools/cloudbuild.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
# because binaries will get built for different architectures and then
1111
# get copied from the built host into the container image
1212
#
13-
# See https://github.com/kubernetes/test-infra/blob/master/config/jobs/image-pushing/README.md
13+
# See https://github.com/kubernetes/test-infra/blob/HEAD/config/jobs/image-pushing/README.md
1414
# for more details on image pushing process in Kubernetes.
1515
#
16-
# To promote release images, see https://github.com/kubernetes/k8s.io/tree/master/k8s.gcr.io/images/k8s-staging-sig-storage.
16+
# To promote release images, see https://github.com/kubernetes/k8s.io/tree/HEAD/k8s.gcr.io/images/k8s-staging-sig-storage.
1717

1818
# This must be specified in seconds. If omitted, defaults to 600s (10 mins).
1919
# Building three images in external-snapshotter takes roughly half an hour,
@@ -27,7 +27,7 @@ steps:
2727
# The image must contain bash and curl. Ideally it should also contain
2828
# the desired version of Go (currently defined in release-tools/prow.sh),
2929
# but that just speeds up the build and is not required.
30-
- name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20200421-a2bf5f8'
30+
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20210917-12df099d55'
3131
entrypoint: ./.cloudbuild.sh
3232
env:
3333
- GIT_TAG=${_GIT_TAG}

release-tools/go-get-kubernetes.sh

+32-3
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,43 @@ set -o pipefail
2626
cmd=$0
2727

2828
function help () {
29-
echo "$cmd <kubernetes version = x.y.z> - update all components from kubernetes/kubernetes to that version"
29+
cat <<EOF
30+
$cmd -p <kubernetes version = x.y.z>
31+
32+
Update all components from kubernetes/kubernetes to that version.
33+
34+
By default, replace statements are added for all Kubernetes packages,
35+
whether they are used or not. This is useful when preparing a
36+
repository for using k8s.io/kubernetes, because those replace
37+
statements are needed to avoid "unknown revision v0.0.0" errors
38+
(https://github.com/kubernetes/kubernetes/issues/79384).
39+
40+
With the optional -p flag, all unused replace statements are
41+
pruned. This makes go.mod smaller, but isn't required.
42+
43+
The replace statements are needed for "go get -u ./..." which
44+
otherwise ends up updating Kubernetes packages like client-go to
45+
incompatible versions (in that case, a very old 1.x release which
46+
happens to have a "higher" version number than the current
47+
0.<Kubernetes minor version>.<Kubernetes patch version> numbers.
48+
EOF
3049
}
3150

51+
prune=false
52+
53+
while getopts "ph" o; do
54+
case "$o" in
55+
h) help; exit 0;;
56+
p) prune=true;;
57+
*) help; exit 1;;
58+
esac
59+
done
60+
shift $((OPTIND-1))
61+
3262
if [ $# -ne 1 ]; then
3363
help
3464
exit 1
3565
fi
36-
case "$1" in -h|--help|help) help; exit 0;; esac
3766

3867
die () {
3968
echo >&2 "$@"
@@ -55,7 +84,7 @@ mods=$( (set -x; curl --silent --show-error --fail "https://raw.githubuserconten
5584
sed -n 's|.*k8s.io/\(.*\) => ./staging/src/k8s.io/.*|k8s.io/\1|p'
5685
) || die "failed to determine Kubernetes staging modules"
5786
for mod in $mods; do
58-
if ! (env GO111MODULE=on go mod graph) | grep "$mod@" > /dev/null; then
87+
if $prune && ! (env GO111MODULE=on go mod graph) | grep "$mod@" > /dev/null; then
5988
echo "Kubernetes module $mod is not used, skipping"
6089
# Remove the module from go.mod "replace" that was added by an older version of this script.
6190
(set -x; env GO111MODULE=on go mod edit "-dropreplace=$mod") || die "'go mod edit' failed"

0 commit comments

Comments
 (0)