From 1ed2b287e31207dd4eccd5ec9ce841f5cf89dfa6 Mon Sep 17 00:00:00 2001 From: James Sturtevant Date: Tue, 2 Mar 2021 19:28:51 -0800 Subject: [PATCH] include nltest in the windows busybox image --- test/e2e/windows/gmsa_full.go | 7 ++++++- test/e2e/windows/gmsa_kubelet.go | 14 ++++++++++++-- test/images/README.md | 2 +- test/images/busybox/Dockerfile | 2 +- test/images/busybox/Dockerfile_windows | 10 ++++++++-- test/images/busybox/VERSION | 2 +- 6 files changed, 29 insertions(+), 8 deletions(-) diff --git a/test/e2e/windows/gmsa_full.go b/test/e2e/windows/gmsa_full.go index 53f60badcaf..8186da5deae 100644 --- a/test/e2e/windows/gmsa_full.go +++ b/test/e2e/windows/gmsa_full.go @@ -375,7 +375,12 @@ func createPodWithGmsa(f *framework.Framework, serviceAccountName string) string Containers: []v1.Container{ { Name: podName, - Image: imageutils.GetPauseImageName(), + Image: imageutils.GetE2EImage(imageutils.BusyBox), + Command: []string{ + "powershell.exe", + "-Command", + "sleep -Seconds 600", + }, }, }, SecurityContext: &v1.PodSecurityContext{ diff --git a/test/e2e/windows/gmsa_kubelet.go b/test/e2e/windows/gmsa_kubelet.go index 27a2b29fc6f..f92775de50d 100644 --- a/test/e2e/windows/gmsa_kubelet.go +++ b/test/e2e/windows/gmsa_kubelet.go @@ -59,11 +59,21 @@ var _ = SIGDescribe("[Feature:Windows] GMSA Kubelet [Slow]", func() { Containers: []v1.Container{ { Name: container1Name, - Image: imageutils.GetPauseImageName(), + Image: imageutils.GetE2EImage(imageutils.BusyBox), + Command: []string{ + "powershell.exe", + "-Command", + "sleep -Seconds 600", + }, }, { Name: container2Name, - Image: imageutils.GetPauseImageName(), + Image: imageutils.GetE2EImage(imageutils.BusyBox), + Command: []string{ + "powershell.exe", + "-Command", + "sleep -Seconds 600", + }, SecurityContext: &v1.SecurityContext{ WindowsOptions: &v1.WindowsSecurityContextOptions{ GMSACredentialSpec: generateDummyCredSpecs(container2Domain), diff --git a/test/images/README.md b/test/images/README.md index d0e01b92dcb..6b259f94439 100644 --- a/test/images/README.md +++ b/test/images/README.md @@ -104,7 +104,7 @@ limitations when it comes to the Windows images: which won't work properly on Windows. See https://github.com/moby/buildkit/issues/1560 - The base image for all the Windows images is nanoserver, which is ~10 times smaller than Windows Servercore. Most binaries added to the image will work out of the box, but some will not due to missing dependencies - (**atention**: the image will still build successfully, even if the added binaries will not work). + (**attention**: the image will still build successfully, even if the added binaries will not work). For example, `coredns.exe` requires `netapi32.dll`, which cannot be found on a nanoserver image, but we can copy it from a servercore image (see the agnhost image's `Dockerfile_windows` file as an example). A good rule of thumb is to use 64-bit applications instead of 32-bit as they have fewer dependencies. diff --git a/test/images/busybox/Dockerfile b/test/images/busybox/Dockerfile index da8f4f2c496..606b94b0380 100644 --- a/test/images/busybox/Dockerfile +++ b/test/images/busybox/Dockerfile @@ -16,4 +16,4 @@ ARG BASEIMAGE FROM $BASEIMAGE -LABEL image_version="1.29" +LABEL image_version="1.29-1" diff --git a/test/images/busybox/Dockerfile_windows b/test/images/busybox/Dockerfile_windows index 0c600a74fae..4a97648a81e 100644 --- a/test/images/busybox/Dockerfile_windows +++ b/test/images/busybox/Dockerfile_windows @@ -14,6 +14,7 @@ ARG BASEIMAGE ARG REGISTRY +ARG OS_VERSION # We're using a Linux image to unpack the archive, then we're copying it over to Windows. FROM --platform=linux/amd64 alpine:3.6 as prep @@ -55,7 +56,7 @@ RUN mkdir /curl-full /curl-dir && \ # Windows Stage - +FROM --platform=linux/amd64 $REGISTRY/windows-servercore-cache:1.0-linux-amd64-$OS_VERSION as servercore-helper FROM e2eteam/powershell-helper:6.2.7 as ps-helper FROM $BASEIMAGE @@ -66,6 +67,11 @@ COPY --from=prep /netcat-dir/nc64.exe /bin/nc.exe COPY --from=prep /dig-dir /dig COPY --from=prep /vcruntime140.dll /Windows/System32/ +# include nltest +COPY --from=servercore-helper /Windows/System32/nltest.exe /Windows/System32/nltest.exe +COPY --from=servercore-helper /Windows/System32/en-US/nltest.exe.mui /Windows/System32/en-US/nltest.exe.mui +COPY --from=servercore-helper /Windows/System32/ntdsapi.dll /Windows/System32/ntdsapi.dll + # include powershell and its Module analysis cache. COPY --from=ps-helper ["/PowerShell", "/Program Files/PowerShell"] @@ -86,5 +92,5 @@ ENV PATH="C:\dig\;C:\bin;C:\curl;C:\Windows\System32;C:\Windows;C:\Program Files # Persist %PSCORE% ENV variable for user convenience PSCORE="C:\Program Files\PowerShell\pwsh.exe" -LABEL image_version="1.29" +LABEL image_version="1.29-1" ENTRYPOINT ["cmd.exe", "/s", "/c"] diff --git a/test/images/busybox/VERSION b/test/images/busybox/VERSION index 9de53f1932a..ce7de4c43ee 100644 --- a/test/images/busybox/VERSION +++ b/test/images/busybox/VERSION @@ -1 +1 @@ -1.29 +1.29-1