Skip to content

Commit 69c24e1

Browse files
committed
Squashed 'release-tools/' changes from 6616a6b..f325590
kubernetes-csi/csi-release-tools@f3255906 Merge kubernetes-csi/csi-release-tools#149 from pohly/cluster-logs kubernetes-csi/csi-release-tools@4b03b308 Merge kubernetes-csi/csi-release-tools#155 from pohly/owners kubernetes-csi/csi-release-tools@a6453c86 owners: introduce aliases kubernetes-csi/csi-release-tools@ad83def4 Merge kubernetes-csi/csi-release-tools#153 from pohly/fix-image-builds kubernetes-csi/csi-release-tools@55617801 build.make: fix image publishng kubernetes-csi/csi-release-tools@29bd39b3 Merge kubernetes-csi/csi-release-tools#152 from pohly/bump-csi-test kubernetes-csi/csi-release-tools@bc427931 prow.sh: use csi-test v4.2.0 kubernetes-csi/csi-release-tools@b546baaf Merge kubernetes-csi/csi-release-tools#150 from mauriciopoppe/windows-multiarch-args kubernetes-csi/csi-release-tools@bfbb6f35 add parameter base_image and addon_image to BUILD_PARAMETERS kubernetes-csi/csi-release-tools@2d61d3bc Merge kubernetes-csi/csi-release-tools#151 from humblec/cm kubernetes-csi/csi-release-tools@48e71f06 Replace `which` command ( non standard) with `command -v` builtin kubernetes-csi/csi-release-tools@feb20e26 prow.sh: collect cluster logs kubernetes-csi/csi-release-tools@7b96bea3 Merge kubernetes-csi/csi-release-tools#148 from dobsonj/add-checkpathcmd-to-prow kubernetes-csi/csi-release-tools@2d2e03b7 prow.sh: enable -csi.checkpathcmd option in csi-sanity kubernetes-csi/csi-release-tools@09d41512 Merge kubernetes-csi/csi-release-tools#147 from pohly/mock-testing kubernetes-csi/csi-release-tools@74cfbc97 prow.sh: support mock tests kubernetes-csi/csi-release-tools@4a3f1103 prow.sh: remove obsolete test suppression git-subtree-dir: release-tools git-subtree-split: f325590
1 parent eb1bf79 commit 69c24e1

7 files changed

+173
-39
lines changed

KUBERNETES_CSI_OWNERS_ALIASES

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
- j-griffith
25+
- Jiawei0227
26+
- jingxu97
27+
- jsafrane
28+
- pohly
29+
- xing-yang
30+
31+
# This documents who previously contributed to Kubernetes-CSI
32+
# as approver.
33+
emeritus_approver:
34+
- lpabon
35+
- sbezverk
36+
- vladimirvivien
37+
38+
# This documents who previously contributed to Kubernetes-CSI
39+
# as reviewer.
40+
emeritus_reviewer:
41+
- lpabon
42+
- saad-ali
43+
- sbezverk
44+
- vladimirvivien

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

OWNERS_ALIASES

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

build.make

+38-11
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -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)