Skip to content

Commit 9eb9a93

Browse files
committed
Squashed 'release-tools/' changes from bc0504a..c0a4fb1
c0a4fb1 Merge pull request kubernetes-csi#164 from anubha-v-ardhan/patch-1 9c6a6c0 Master to main cleanup 682c686 Merge pull request kubernetes-csi#162 from pohly/pod-name-via-shell-command 36a29f5 Merge pull request kubernetes-csi#163 from pohly/remove-bazel 68e43ca prow.sh: remove Bazel build support c5f59c5 prow.sh: allow shell commands in CSI_PROW_SANITY_POD 71c810a Merge pull request kubernetes-csi#161 from pohly/mock-test-fixes 9e438f8 prow.sh: fix mock testing d7146c7 Merge pull request kubernetes-csi#160 from pohly/kind-update 4b6aa60 prow.sh: update to KinD v0.11.0 7cdc76f Merge pull request kubernetes-csi#159 from pohly/fix-deployment-selection ef8bd33 prow.sh: more flexible CSI_PROW_DEPLOYMENT, part II 204bc89 Merge pull request kubernetes-csi#158 from pohly/fix-deployment-selection 61538bb prow.sh: more flexible CSI_PROW_DEPLOYMENT 2b0e6db Merge pull request kubernetes-csi#157 from humblec/csi-release a2fcd6d Adding myself to csi reviewers group f325590 Merge pull request kubernetes-csi#149 from pohly/cluster-logs 4b03b30 Merge pull request kubernetes-csi#155 from pohly/owners a6453c8 owners: introduce aliases ad83def Merge pull request kubernetes-csi#153 from pohly/fix-image-builds 5561780 build.make: fix image publishng 29bd39b Merge pull request kubernetes-csi#152 from pohly/bump-csi-test bc42793 prow.sh: use csi-test v4.2.0 b546baa Merge pull request kubernetes-csi#150 from mauriciopoppe/windows-multiarch-args bfbb6f3 add parameter base_image and addon_image to BUILD_PARAMETERS 2d61d3b Merge pull request kubernetes-csi#151 from humblec/cm 48e71f0 Replace `which` command ( non standard) with `command -v` builtin feb20e2 prow.sh: collect cluster logs 7b96bea Merge pull request kubernetes-csi#148 from dobsonj/add-checkpathcmd-to-prow 2d2e03b prow.sh: enable -csi.checkpathcmd option in csi-sanity 09d4151 Merge pull request kubernetes-csi#147 from pohly/mock-testing 74cfbc9 prow.sh: support mock tests 4a3f110 prow.sh: remove obsolete test suppression 6616a6b Merge pull request kubernetes-csi#146 from pohly/kubernetes-1.21 510fb0f prow.sh: support Kubernetes 1.21 c63c61b prow.sh: add CSI_PROW_DEPLOYMENT_SUFFIX 51ac11c Merge pull request kubernetes-csi#144 from pohly/pull-jobs dd54c92 pull-test.sh: test importing csi-release-tools into other repo 7d2643a Merge pull request kubernetes-csi#143 from pohly/path-setup 6880b0c prow.sh: avoid creating paths unless really running tests git-subtree-dir: release-tools git-subtree-split: c0a4fb1
1 parent 4683101 commit 9eb9a93

9 files changed

+284
-92
lines changed

KUBERNETES_CSI_OWNERS_ALIASES

Lines changed: 45 additions & 0 deletions
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

OWNERS

Lines changed: 2 additions & 5 deletions
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

OWNERS_ALIASES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
KUBERNETES_CSI_OWNERS_ALIASES

SIDECAR_RELEASE_PROCESS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ naming convention `<hostpath-deployment-version>-on-<kubernetes-version>`.
9595
1. Check [image build status](https://k8s-testgrid.appspot.com/sig-storage-image-build).
9696
1. Promote images from k8s-staging-sig-storage to k8s.gcr.io/sig-storage. From
9797
the [k8s image
98-
repo](https://github.com/kubernetes/k8s.io/tree/master/k8s.gcr.io/images/k8s-staging-sig-storage),
98+
repo](https://github.com/kubernetes/k8s.io/tree/main/k8s.gcr.io/images/k8s-staging-sig-storage),
9999
run `./generate.sh > images.yaml`, and send a PR with the updated images.
100100
Once merged, the image promoter will copy the images from staging to prod.
101101
1. Update [kubernetes-csi/docs](https://github.com/kubernetes-csi/docs) sidecar

build.make

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
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
@@ -63,26 +66,35 @@ endif
6366
# Specific packages can be excluded from each of the tests below by setting the *_FILTER_CMD variables
6467
# to something like "| grep -v 'github.com/kubernetes-csi/project/pkg/foobar'". See usage below.
6568

66-
# BUILD_PLATFORMS contains a set of <os> <arch> <suffix> triplets,
69+
# BUILD_PLATFORMS contains a set of tuples [os arch suffix base_image addon_image]
6770
# separated by semicolon. An empty variable or empty entry (= just a
6871
# semicolon) builds for the default platform of the current Go
6972
# toolchain.
7073
BUILD_PLATFORMS =
7174

7275
# Add go ldflags using LDFLAGS at the time of compilation.
73-
IMPORTPATH_LDFLAGS = -X main.version=$(REV)
76+
IMPORTPATH_LDFLAGS = -X main.version=$(REV)
7477
EXT_LDFLAGS = -extldflags "-static"
75-
LDFLAGS =
78+
LDFLAGS =
7679
FULL_LDFLAGS = $(LDFLAGS) $(IMPORTPATH_LDFLAGS) $(EXT_LDFLAGS)
7780
# This builds each command (= the sub-directories of ./cmd) for the target platform(s)
7881
# defined by BUILD_PLATFORMS.
7982
$(CMDS:%=build-%): build-%: check-go-version-go
8083
mkdir -p bin
81-
echo '$(BUILD_PLATFORMS)' | tr ';' '\n' | while read -r os arch suffix; do \
84+
# os_arch_seen captures all of the $$os-$$arch seen for the current binary
85+
# that we want to build, if we've seen an $$os-$$arch before it means that
86+
# we don't need to build it again, this is done to avoid building
87+
# the windows binary multiple times (see the default value of $$BUILD_PLATFORMS)
88+
export os_arch_seen="" && echo '$(BUILD_PLATFORMS)' | tr ';' '\n' | while read -r os arch suffix base_image addon_image; do \
89+
os_arch_seen_pre=$${os_arch_seen%%$$os-$$arch*}; \
90+
if ! [ $${#os_arch_seen_pre} = $${#os_arch_seen} ]; then \
91+
continue; \
92+
fi; \
8293
if ! (set -x; CGO_ENABLED=0 GOOS="$$os" GOARCH="$$arch" go build $(GOFLAGS_VENDOR) -a -ldflags '$(FULL_LDFLAGS)' -o "./bin/$*$$suffix" ./cmd/$*); then \
8394
echo "Building $* for GOOS=$$os GOARCH=$$arch failed, see error(s) above."; \
8495
exit 1; \
8596
fi; \
97+
os_arch_seen+=";$$os-$$arch"; \
8698
done
8799

88100
$(CMDS:%=container-%): container-%: build-%
@@ -131,30 +143,46 @@ DOCKER_BUILDX_CREATE_ARGS ?=
131143
# the tag for the resulting multiarch image.
132144
$(CMDS:%=push-multiarch-%): push-multiarch-%: check-pull-base-ref build-%
133145
set -ex; \
134-
DOCKER_CLI_EXPERIMENTAL=enabled; \
135-
export DOCKER_CLI_EXPERIMENTAL; \
146+
export DOCKER_CLI_EXPERIMENTAL=enabled; \
136147
docker buildx create $(DOCKER_BUILDX_CREATE_ARGS) --use --name multiarchimage-buildertest; \
137148
trap "docker buildx rm multiarchimage-buildertest" EXIT; \
138149
dockerfile_linux=$$(if [ -e ./cmd/$*/Dockerfile ]; then echo ./cmd/$*/Dockerfile; else echo Dockerfile; fi); \
139150
dockerfile_windows=$$(if [ -e ./cmd/$*/Dockerfile.Windows ]; then echo ./cmd/$*/Dockerfile.Windows; else echo Dockerfile.Windows; fi); \
140151
if [ '$(BUILD_PLATFORMS)' ]; then build_platforms='$(BUILD_PLATFORMS)'; else build_platforms="linux amd64"; fi; \
141152
if ! [ -f "$$dockerfile_windows" ]; then \
142-
build_platforms="$$(echo "$$build_platforms" | sed -e 's/windows *[^ ]* *.exe//g' -e 's/; *;/;/g')"; \
153+
build_platforms="$$(echo "$$build_platforms" | sed -e 's/windows *[^ ]* *.exe *[^ ]* *[^ ]*//g' -e 's/; *;/;/g' -e 's/;[ ]*$$//')"; \
143154
fi; \
144155
pushMultiArch () { \
145156
tag=$$1; \
146-
echo "$$build_platforms" | tr ';' '\n' | while read -r os arch suffix; do \
157+
echo "$$build_platforms" | tr ';' '\n' | while read -r os arch suffix base_image addon_image; do \
158+
escaped_base_image=$${base_image/:/-}; \
159+
if ! [ -z $$escaped_base_image ]; then escaped_base_image+="-"; fi; \
147160
docker buildx build --push \
148-
--tag $(IMAGE_NAME):$$arch-$$os-$$tag \
161+
--tag $(IMAGE_NAME):$$arch-$$os-$$escaped_base_image$$tag \
149162
--platform=$$os/$$arch \
150163
--file $$(eval echo \$${dockerfile_$$os}) \
151164
--build-arg binary=./bin/$*$$suffix \
152165
--build-arg ARCH=$$arch \
166+
--build-arg BASE_IMAGE=$$base_image \
167+
--build-arg ADDON_IMAGE=$$addon_image \
153168
--label revision=$(REV) \
154169
.; \
155170
done; \
156-
images=$$(echo "$$build_platforms" | tr ';' '\n' | while read -r os arch suffix; do echo $(IMAGE_NAME):$$arch-$$os-$$tag; done); \
171+
images=$$(echo "$$build_platforms" | tr ';' '\n' | while read -r os arch suffix base_image addon_image; do \
172+
escaped_base_image=$${base_image/:/-}; \
173+
if ! [ -z $$escaped_base_image ]; then escaped_base_image+="-"; fi; \
174+
echo $(IMAGE_NAME):$$arch-$$os-$$escaped_base_image$$tag; \
175+
done); \
157176
docker manifest create --amend $(IMAGE_NAME):$$tag $$images; \
177+
echo "$$build_platforms" | tr ';' '\n' | while read -r os arch suffix base_image addon_image; do \
178+
if [ $$os = "windows" ]; then \
179+
escaped_base_image=$${base_image/:/-}; \
180+
if ! [ -z $$escaped_base_image ]; then escaped_base_image+="-"; fi; \
181+
image=$(IMAGE_NAME):$$arch-$$os-$$escaped_base_image$$tag; \
182+
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; \
183+
docker manifest annotate --os-version $$os_version $(IMAGE_NAME):$$tag $$image; \
184+
fi; \
185+
done; \
158186
docker manifest push -p $(IMAGE_NAME):$$tag; \
159187
}; \
160188
if [ $(PULL_BASE_REF) = "master" ]; then \
@@ -288,4 +316,3 @@ test-spelling:
288316
test-boilerplate:
289317
@ echo; echo "### $@:"
290318
@ ./release-tools/verify-boilerplate.sh "$(pwd)"
291-

cloudbuild.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See https://github.com/kubernetes/test-infra/blob/master/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/main/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-testimages/gcb-docker-gcloud:v20210331-c732583'
3131
entrypoint: ./.cloudbuild.sh
3232
env:
3333
- GIT_TAG=${_GIT_TAG}

0 commit comments

Comments
 (0)