Skip to content

Commit

Permalink
build: remove traces of building a Windows image
Browse files Browse the repository at this point in the history
  • Loading branch information
dkoshkin committed Oct 24, 2024
1 parent dd188ce commit c0ead20
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 25 deletions.
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ GOVERSION ?= 1.17
# These env vars have default values set from hack/release.sh, the values
# shown here are for `make` and `make verify` only
LINUX_ARCH ?= amd64
WINDOWS_DISTROS ?=

DOCKER=DOCKER_CLI_EXPERIMENTAL=enabled docker
STAGINGVERSION=${VERSION}
Expand All @@ -39,9 +38,7 @@ all: build-container-linux-amd64

cross: init-buildx \
$(addprefix build-and-push-container-linux-,$(LINUX_ARCH)) \
$(addprefix build-and-push-node-cleanup-controller-linux-,$(LINUX_ARCH)) \
$(addprefix build-and-push-container-windows-,$(WINDOWS_DISTROS)) \
$(addprefix build-and-push-node-cleanup-controller-windows-,$(WINDOWS_DISTROS))
$(addprefix build-and-push-node-cleanup-controller-linux-,$(LINUX_ARCH))
.PHONY: cross

verify:
Expand Down
2 changes: 1 addition & 1 deletion cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ steps:
- GIT_TAG=${_GIT_TAG}
- PULL_BASE_REF=${_PULL_BASE_REF}
- HOME=/root
# intentionally not setting LINUX_ARCH and WINDOWS_DISTROS
# intentionally not setting LINUX_ARCH
# the default ones in hack/release.sh will be used instead
substitutions:
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and
Expand Down
24 changes: 4 additions & 20 deletions hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ Environments:
SKIP_BUILD set this to skip build phase (debug only)
SKIP_PUSH_LATEST set this to skip pushing the latest stable image as the latest image
LINUX_ARCH Linux architectures to build
WINDOWS_DISTROS Windows distros to build
Examples:
Expand All @@ -66,7 +65,7 @@ Examples:
3) Release multi-arch image to your own registry
REGISTRY=quay.io/<yourname> LINUX_ARCH="amd64 arm64" WINDOWS_DISTROS="ltsc2019 1909" ./hack/release.sh
REGISTRY=quay.io/<yourname> LINUX_ARCH="amd64 arm64" ./hack/release.sh
EOF
}
Expand All @@ -91,7 +90,6 @@ ALLOW_OVERRIDE=${ALLOW_OVERRIDE:-}
SKIP_BUILD=${SKIP_BUILD:-}
SKIP_PUSH_LATEST=${SKIP_PUSH_LATEST:-}
LINUX_ARCH=${LINUX_ARCH:-amd64 arm arm64 ppc64le s390x}
WINDOWS_DISTROS=${WINDOWS_DISTROS:-1809 ltsc2022}

echo "REGISTRY: $REGISTRY"
echo "VERSION: $VERSION"
Expand All @@ -104,7 +102,6 @@ echo "ALLOW_OVERRIDE: $ALLOW_OVERRIDE"
echo "SKIP_BUILD: $SKIP_BUILD"
echo "SKIP_PUSH_LATEST: $SKIP_PUSH_LATEST"
echo "LINUX_ARCH: $LINUX_ARCH"
echo "WINDOWS_DISTROS: $WINDOWS_DISTROS"
go version

IMAGE="$REGISTRY/local-volume-provisioner"
Expand Down Expand Up @@ -217,8 +214,7 @@ if [ -z "$SKIP_BUILD" ]; then
make cross \
REGISTRY=$REGISTRY \
VERSION=$VERSION \
LINUX_ARCH="$LINUX_ARCH" \
WINDOWS_DISTROS="$WINDOWS_DISTROS"
LINUX_ARCH="$LINUX_ARCH"
else
echo "info: build and push is skipped"
fi
Expand All @@ -234,10 +230,7 @@ function docker_create_multi_arch() {
local linux_images=$(echo "${LINUX_ARCH}" | tr ' ' '\n' | while read -r arch; do \
echo $image:${VERSION}_linux_${arch}; \
done);
local windows_images=$(echo "${WINDOWS_DISTROS}" | tr ' ' '\n' | while read -r distro; do \
echo $image:${VERSION}_windows_${distro}; \
done);
local all_images="${linux_images} ${windows_images}"
local all_images="${linux_images}"
# create a manifest with all the images created
docker manifest create --amend $manifest_image $all_images
Expand All @@ -249,15 +242,6 @@ function docker_create_multi_arch() {
docker manifest annotate --arch $arch $manifest_image $linux_image
done
# annotate the windows images with the base image os-version
# from https://github.com/kubernetes-csi/csi-release-tools/blob/5b9a1e06794ddb137ff7e2d565416cc6934ec380/build.make#L181-L189
echo "${WINDOWS_DISTROS}" | tr ' ' '\n' | while read -r distro; do
local windows_image=$image:${VERSION}_windows_${distro}
# the image matches the value in the Makefile
local os_version=$(docker manifest inspect mcr.microsoft.com/windows/servercore:${distro} | grep "os.version" | head -n 1 | awk '{print $2}' | sed -e 's/"//g')
docker manifest annotate --os-version ${os_version} $manifest_image $windows_image
done
docker manifest push --purge $manifest_image
}
Expand Down Expand Up @@ -290,4 +274,4 @@ echo "info: VERSION '$VERSION' is latest stable version, tagging $IMAGE as lates
docker_create_multi_arch latest $IMAGE
echo "info: VERSION '$VERSION' is latest stable version, tagging $NODECLEANUPCONTROLLERIMAGE as latest"
docker_create_multi_arch latest $NODECLEANUPCONTROLLERIMAGE
docker_create_multi_arch latest $NODECLEANUPCONTROLLERIMAGE

0 comments on commit c0ead20

Please sign in to comment.