Skip to content

Commit 9a7815d

Browse files
authored
Revert "added windows 2022 support (#1057)"
This reverts commit 79488f8.
1 parent 2bb0d5e commit 9a7815d

File tree

6 files changed

+24
-75
lines changed

6 files changed

+24
-75
lines changed

.github/workflows/build-and-test.yaml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,7 @@ jobs:
124124

125125
buildWindows:
126126
name: Build Windows Binaries
127-
strategy:
128-
matrix:
129-
version: [2019, 2022]
130-
runs-on: windows-${{matrix.version}}
127+
runs-on: windows-2019
131128
steps:
132129
- name: Set up Go 1.x
133130
uses: actions/setup-go@v2
@@ -152,14 +149,11 @@ jobs:
152149
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
153150
refreshenv
154151
155-
choco install make && choco install zip && make build-binaries-windows-${{matrix.version}}
152+
choco install make && choco install zip && make build-binaries-windows
156153
157154
buildWindowsDocker:
158155
name: Build Windows Docker Images
159-
strategy:
160-
matrix:
161-
version: [2019, 2022]
162-
runs-on: windows-${{matrix.version}}
156+
runs-on: windows-2019
163157
steps:
164158
- name: Set up Go 1.x
165159
uses: actions/setup-go@v2
@@ -184,7 +178,7 @@ jobs:
184178
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
185179
refreshenv
186180
187-
choco install make && make build-docker-images-windows-${{matrix.version}}
181+
choco install make && make build-docker-images-windows
188182
189183
e2e:
190184
name: E2E Tests
@@ -211,4 +205,4 @@ jobs:
211205
key: gocache
212206

213207
- name: E2E Tests
214-
run: test/k8s-local-cluster-test/run-test -v ${{ matrix.k8sVersion }}
208+
run: test/k8s-local-cluster-test/run-test -v ${{ matrix.k8sVersion }}

.github/workflows/release.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,8 @@ jobs:
3636

3737
releaseWindows:
3838
name: Release Windows
39+
runs-on: windows-2019
3940
needs: [releaseLinux]
40-
strategy:
41-
matrix:
42-
version: [2019, 2022]
43-
runs-on: windows-${{matrix.version}}
4441
steps:
4542
- name: Set up Go 1.x
4643
uses: actions/setup-go@v2
@@ -56,7 +53,7 @@ jobs:
5653
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
5754
refreshenv
5855
59-
choco install make && choco install zip && make release-windows-${{matrix.version}}
56+
choco install make && choco install zip && make release-windows
6057
env:
6158
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
6259
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -94,4 +91,4 @@ jobs:
9491
env:
9592
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
9693
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
97-
AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }}
94+
AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }}

Makefile

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,7 @@ MAKEFILE_PATH = $(dir $(realpath -s $(firstword $(MAKEFILE_LIST))))
1717
BUILD_DIR_PATH = ${MAKEFILE_PATH}/build
1818
BIN_DIR = ${MAKEFILE_PATH}/bin
1919
SUPPORTED_PLATFORMS_LINUX ?= "linux/amd64,linux/arm64"
20-
21-
# Each windows version needs a separate make target because each build
22-
# needs to happen on a separate GitHub runner
23-
# A windows version is specified by major-minor-build-revision.
24-
# The build number of the OS must match the build number of the container image
25-
# The revision does not matter for windows 2019 and 2022.
26-
# Reference: https://learn.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility
27-
WINDOWS_2019 ?= "windows-10.0.17763.6189/amd64"
28-
WINDOWS_2022 ?= "windows-10.0.20348.2582/amd64"
29-
20+
SUPPORTED_PLATFORMS_WINDOWS ?= "windows/amd64"
3021
BINARY_NAME ?= "node-termination-handler"
3122
THIRD_PARTY_LICENSES = "${MAKEFILE_PATH}/THIRD_PARTY_LICENSES.md"
3223
GOLICENSES = $(BIN_DIR)/go-licenses
@@ -57,32 +48,18 @@ docker-run:
5748
build-docker-images:
5849
${MAKEFILE_PATH}/scripts/build-docker-images -p ${SUPPORTED_PLATFORMS_LINUX} -r ${IMG} -v ${VERSION}
5950

60-
build-docker-images-windows-2019:
61-
${MAKEFILE_PATH}/scripts/build-docker-images -p ${WINDOWS_2019} -r ${IMG} -v ${VERSION}
62-
63-
build-docker-images-windows-2022:
64-
${MAKEFILE_PATH}/scripts/build-docker-images -p ${WINDOWS_2022} -r ${IMG} -v ${VERSION}
65-
66-
ecr-public-login:
67-
@ECR_REGISTRY=${ECR_REGISTRY} ${MAKEFILE_PATH}/scripts/ecr-public-login
51+
build-docker-images-windows:
52+
${MAKEFILE_PATH}/scripts/build-docker-images -p ${SUPPORTED_PLATFORMS_WINDOWS} -r ${IMG} -v ${VERSION}
6853

6954
push-docker-images:
7055
${MAKEFILE_PATH}/scripts/retag-docker-images -p ${SUPPORTED_PLATFORMS_LINUX} -v ${VERSION} -o ${IMG} -n ${ECR_REPO}
7156
@ECR_REGISTRY=${ECR_REGISTRY} ${MAKEFILE_PATH}/scripts/ecr-public-login
7257
${MAKEFILE_PATH}/scripts/push-docker-images -p ${SUPPORTED_PLATFORMS_LINUX} -r ${ECR_REPO} -v ${VERSION} -m
7358

74-
amazon-ecr-credential-helper:
59+
push-docker-images-windows:
60+
${MAKEFILE_PATH}/scripts/retag-docker-images -p ${SUPPORTED_PLATFORMS_WINDOWS} -v ${VERSION} -o ${IMG} -n ${ECR_REPO}
7561
bash ${MAKEFILE_PATH}/scripts/install-amazon-ecr-credential-helper $(AMAZON_ECR_CREDENTIAL_HELPER_VERSION)
76-
77-
push-docker-images-windows-2019:
78-
${MAKEFILE_PATH}/scripts/retag-docker-images -p ${WINDOWS_2019} -v ${VERSION} -o ${IMG} -n ${ECR_REPO}
79-
bash ${MAKEFILE_PATH}/scripts/install-amazon-ecr-credential-helper $(AMAZON_ECR_CREDENTIAL_HELPER_VERSION)
80-
${MAKEFILE_PATH}/scripts/push-docker-images -p ${WINDOWS_2019} -r ${ECR_REPO} -v ${VERSION} -m
81-
82-
push-docker-images-windows-2022:
83-
${MAKEFILE_PATH}/scripts/retag-docker-images -p ${WINDOWS_2022} -v ${VERSION} -o ${IMG} -n ${ECR_REPO}
84-
bash ${MAKEFILE_PATH}/scripts/install-amazon-ecr-credential-helper $(AMAZON_ECR_CREDENTIAL_HELPER_VERSION)
85-
${MAKEFILE_PATH}/scripts/push-docker-images -p ${WINDOWS_2022} -r ${ECR_REPO} -v ${VERSION} -m
62+
${MAKEFILE_PATH}/scripts/push-docker-images -p ${SUPPORTED_PLATFORMS_WINDOWS} -r ${ECR_REPO} -v ${VERSION} -m
8663

8764
push-helm-chart:
8865
@ECR_REGISTRY=${ECR_REGISTRY} ${MAKEFILE_PATH}/scripts/helm-login
@@ -145,11 +122,8 @@ helm-validate-chart-versions:
145122
build-binaries:
146123
${MAKEFILE_PATH}/scripts/build-binaries -p ${SUPPORTED_PLATFORMS_LINUX} -v ${VERSION}
147124

148-
build-binaries-windows-2019:
149-
${MAKEFILE_PATH}/scripts/build-binaries -p ${WINDOWS_2019} -v ${VERSION}
150-
151-
build-binaries-windows-2022:
152-
${MAKEFILE_PATH}/scripts/build-binaries -p ${WINDOWS_2022} -v ${VERSION}
125+
build-binaries-windows:
126+
${MAKEFILE_PATH}/scripts/build-binaries -p ${SUPPORTED_PLATFORMS_WINDOWS} -v ${VERSION}
153127

154128
upload-resources-to-github:
155129
${MAKEFILE_PATH}/scripts/upload-resources-to-github
@@ -191,9 +165,7 @@ eks-cluster-test:
191165

192166
release: build-binaries build-docker-images push-docker-images generate-k8s-yaml upload-resources-to-github
193167

194-
release-windows-2019: build-binaries-windows-2019 build-docker-images-windows-2019 push-docker-images-windows-2019
195-
196-
release-windows-2022: build-binaries-windows-2022 build-docker-images-windows-2022 push-docker-images-windows-2022
168+
release-windows: build-binaries-windows build-docker-images-windows push-docker-images-windows
197169

198170
test: spellcheck shellcheck unit-test e2e-test compatibility-test license-test go-linter helm-version-sync-test helm-lint
199171

scripts/build-binaries

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ for os_arch in "${PLATFORMS[@]}"; do
4949
container_name="build-$BASE_BIN_NAME-$os-$arch"
5050
repo_name="bin-build"
5151

52-
if [[ $os == "windows"* ]]; then
52+
if [[ $os == "windows" ]]; then
5353
bin_name="$BASE_BIN_NAME-$os-$arch.exe"
5454
else
5555
bin_name="$BASE_BIN_NAME-$os-$arch"
@@ -60,7 +60,7 @@ for os_arch in "${PLATFORMS[@]}"; do
6060
docker container create --rm --name $container_name "$repo_name:$VERSION-$os-$arch"
6161
docker container cp $container_name:/${BASE_BIN_NAME} $BIN_DIR/$bin_name
6262

63-
if [[ $os == "windows"* ]]; then
63+
if [[ $os == "windows" ]]; then
6464
## Create zip archive with binary taking into account windows .exe
6565
cp ${BIN_DIR}/${bin_name} ${BIN_DIR}/${BASE_BIN_NAME}.exe
6666
## Can't reuse bin_name below because it includes .exe

scripts/build-docker-images

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,20 @@ for os_arch in "${PLATFORMS[@]}"; do
4848
os=$(echo $os_arch | cut -d'/' -f1)
4949
arch=$(echo $os_arch | cut -d'/' -f2)
5050

51+
img_tag="$IMAGE_REPO:$VERSION-$os-$arch"
52+
5153
dockerfile="$DOCKERFILE_PATH"
52-
if [[ $os == "windows"* ]]; then
53-
windows_version=$(echo $os | cut -d'-' -f2)
54-
os=$(echo $os | cut -d'-' -f1)
55-
img_tag="$IMAGE_REPO:$VERSION-$os-$windows_version-$arch"
54+
if [[ $os = "windows" ]]; then
5655
dockerfile="${dockerfile}.windows"
5756
docker build \
5857
--file "${dockerfile}" \
5958
--build-arg GOOS=${os} \
6059
--build-arg GOARCH=${arch} \
61-
--build-arg WINDOWS_VERSION=${windows_version} \
6260
--build-arg GOPROXY=${GOPROXY} \
6361
--tag ${img_tag} \
6462
${REPO_ROOT_PATH}
6563
else
6664
# Launch a docker buildx instance and save its name so we can terminate it later
67-
img_tag="$IMAGE_REPO:$VERSION-$os-$arch"
6865
buildx_instance_name=$(docker buildx create --use)
6966
docker buildx build \
7067
--load \

scripts/push-docker-images

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,9 @@ if [[ $MANIFEST == "true" ]]; then
6868
if [[ manifest_exists -eq 0 ]]; then
6969
echo "manifest already exists"
7070
EXISTING_IMAGES=()
71-
72-
# Run while loop to collect images with no OS version (typically linux)
73-
while IFS='' read -r line; do
74-
EXISTING_IMAGES+=("$line");
75-
done < <(docker manifest inspect $IMAGE_REPO:$VERSION | jq -r '.manifests[] | select(.platform."os.version" == null) | "\(.platform.os)-\(.platform.architecture)"')
76-
77-
# Run while loop to collect images with OS version (typically windows)
7871
while IFS='' read -r line; do
7972
EXISTING_IMAGES+=("$line");
80-
done < <(docker manifest inspect $IMAGE_REPO:$VERSION | jq -r '.manifests[] | select(.platform."os.version" != null) | "\(.platform.os)-\(.platform."os.version")-\(.platform.architecture)"')
81-
73+
done < <(docker manifest inspect $IMAGE_REPO:$VERSION | jq -r '.manifests[] | "\(.platform.os)-\(.platform.architecture)"')
8274
# treat separate from PLATFORMS because existing images don't need to be tagged and pushed
8375
for os_arch in "${EXISTING_IMAGES[@]}"; do
8476
img_tag="$IMAGE_REPO:$VERSION-$os_arch"
@@ -125,10 +117,7 @@ if [[ $MANIFEST == "true" ]]; then
125117
# However, our builds in the past required this explicit annotation, and it doesn't hurt to keep it for now.
126118
os_arch=$(echo ${updated_img//$IMAGE_REPO:$VERSION-/})
127119
os=$(echo $os_arch | cut -d'-' -f1)
128-
129-
# os_arch may be linux-amd64 or windows-10.0.17763.6189-amd64. To get the proper architecture, the bash command
130-
# will extract the last element after the hyphen (-).
131-
arch=${os_arch##*-}
120+
arch=$(echo $os_arch | cut -d'-' -f2)
132121

133122
echo "annotating manifest"
134123
docker manifest annotate $IMAGE_REPO:$VERSION $updated_img --arch $arch --os $os

0 commit comments

Comments
 (0)