From 3c1a3dea59c31ab9f5e1ff2350eca719af3c2b2c Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Thu, 19 Aug 2021 11:16:27 +0000 Subject: [PATCH] test images: Adds Windows Server 2022 to the BASEIMAGEs The Container Images for Windows Server 2022 have been published, and we can start building test images using them, so we can start adding jobs for them. The image versions for the e2e test images have been bumped in a previous commit, but haven't been promoted yet. We don't need to bump them here. We're starting with windows-servercore-cache and busybox images, since they are needed for the other images the most. A previous added LD_FLAGS for the go binary compilation, but it's not defined for all images. --- test/images/busybox/BASEIMAGE | 1 + test/images/image-util.sh | 4 ++-- test/images/windows-servercore-cache/BASEIMAGE | 1 + test/images/windows-servercore-cache/Dockerfile | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/images/busybox/BASEIMAGE b/test/images/busybox/BASEIMAGE index 2ba6efb4fc4..9f6c229f27d 100644 --- a/test/images/busybox/BASEIMAGE +++ b/test/images/busybox/BASEIMAGE @@ -6,3 +6,4 @@ linux/s390x=s390x/busybox:1.29 windows/amd64/1809=mcr.microsoft.com/windows/nanoserver:1809 windows/amd64/2004=mcr.microsoft.com/windows/nanoserver:2004 windows/amd64/20H2=mcr.microsoft.com/windows/nanoserver:20H2 +windows/amd64/ltsc2022=mcr.microsoft.com/windows/nanoserver:ltsc2022 diff --git a/test/images/image-util.sh b/test/images/image-util.sh index 81120aa2a07..f110fc31024 100755 --- a/test/images/image-util.sh +++ b/test/images/image-util.sh @@ -39,7 +39,7 @@ declare -A QEMUARCHS=( ["amd64"]="x86_64" ["arm"]="arm" ["arm64"]="aarch64" ["pp # NOTE(claudiub): In the test image build jobs, this script is not being run in a git repository, # which would cause git log to fail. Instead, we can use the GIT_COMMIT_ID set in cloudbuild.yaml. GIT_COMMIT_ID=$(git log -1 --format=%h || echo "${GIT_COMMIT_ID}") -windows_os_versions=(1809 2004 20H2) +windows_os_versions=(1809 2004 20H2 ltsc2022) declare -A WINDOWS_OS_VERSIONS_MAP initWindowsOsVersions() { @@ -269,7 +269,7 @@ bin() { golang:"${GOLANG_VERSION}" \ /bin/bash -c "\ cd /go/src/k8s.io/kubernetes/test/images/${SRC_DIR} && \ - CGO_ENABLED=0 ${arch_prefix} GOOS=${OS} GOARCH=${ARCH} go build -a -installsuffix cgo --ldflags \"-w ${LD_FLAGS}\" -o ${TARGET}/${SRC} ./$(dirname "${SRC}")" + CGO_ENABLED=0 ${arch_prefix} GOOS=${OS} GOARCH=${ARCH} go build -a -installsuffix cgo --ldflags \"-w ${LD_FLAGS:-}\" -o ${TARGET}/${SRC} ./$(dirname "${SRC}")" done } diff --git a/test/images/windows-servercore-cache/BASEIMAGE b/test/images/windows-servercore-cache/BASEIMAGE index e279675681b..8174e8d0cd3 100644 --- a/test/images/windows-servercore-cache/BASEIMAGE +++ b/test/images/windows-servercore-cache/BASEIMAGE @@ -1,3 +1,4 @@ linux/amd64/1809=mcr.microsoft.com/windows/servercore:ltsc2019 linux/amd64/2004=mcr.microsoft.com/windows/servercore:2004 linux/amd64/20H2=mcr.microsoft.com/windows/servercore:20H2 +linux/amd64/ltsc2022=mcr.microsoft.com/windows/servercore:ltsc2022 diff --git a/test/images/windows-servercore-cache/Dockerfile b/test/images/windows-servercore-cache/Dockerfile index b92bffab20c..633c44e3e87 100644 --- a/test/images/windows-servercore-cache/Dockerfile +++ b/test/images/windows-servercore-cache/Dockerfile @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG OS_VERSION -FROM --platform=windows/amd64 mcr.microsoft.com/windows/servercore:$OS_VERSION as prep +ARG BASEIMAGE +FROM --platform=windows/amd64 $BASEIMAGE as prep FROM scratch COPY --from=prep /Windows/System32/en-US/nltest.exe.mui /Windows/System32/en-US/nltest.exe.mui