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.
This commit is contained in:
Claudiu Belu 2021-08-19 11:16:27 +00:00
parent 3945e35f1c
commit 3c1a3dea59
4 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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
}

View File

@ -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

View File

@ -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