Skip to content

Commit abfb411

Browse files
committed
Switch to multiarch image by default
1 parent 0ffd94b commit abfb411

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

kubectl-node_shell

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,13 @@ os="$($kubectl get node $node -o jsonpath="{.metadata.labels.kubernetes\.io/os}"
8585

8686
# Set pod configuration per operating system
8787
if [ "$os" = "windows" ]; then
88-
image="${KUBECTL_NODE_SHELL_IMAGE_WINDOWS:-mcr.microsoft.com/powershell}"
88+
image="${KUBECTL_NODE_SHELL_IMAGE_WINDOWS:-ghcr.io/feiskyer/winservercore:v1.0}"
8989
name="pwsh"
9090
pod="${name}-$(env LC_ALL=C tr -dc a-z0-9 </dev/urandom | head -c 6)"
9191
# pwsh has to be launched via cmd.exe because of how containerd 1.6 handles the mount of the container filesystem
9292
# see https://kubernetes.io/docs/tasks/configure-pod-container/create-hostprocess-pod/#volume-mounts
93-
cmd_default='"cmd.exe", "/c", "%CONTAINER_SANDBOX_MOUNT_POINT%\\Program Files\\PowerShell\\pwsh.exe", "-nol", "-wd", "C:\\"'
93+
cmd_default='"cmd.exe", "/c", "cd c:/ & %CONTAINER_SANDBOX_MOUNT_POINT%\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -nol"'
9494
cmd_start="${KUBECTL_NODE_SHELL_COMMAND_WINDOWS:-$cmd_default}"
95-
if [ $image = "mcr.microsoft.com/powershell" ] || [ $image = "mcr.microsoft.com/powershell:latest" ]; then
96-
# Path "PowerShell\\latest\\pwsh.exe" should be used if the powershell image is using latest tag
97-
cmd_start='"cmd.exe", "/c", "%CONTAINER_SANDBOX_MOUNT_POINT%\\Program Files\\PowerShell\\latest\\pwsh.exe", "-nol", "-wd", "C:\\"'
98-
fi
9995
cmd_arg_prefix=', "-Command"'
10096
cmd_default=''
10197
security_context='{"privileged":true,"windowsOptions":{"hostProcess":true,"runAsUserName":"NT AUTHORITY\\SYSTEM"}}'

0 commit comments

Comments
 (0)