GCE Windows: Do not install docker when containerd CRI is selected.

This commit is contained in:
Jeremy Edwards 2021-05-05 19:16:33 +00:00
parent aab19d4299
commit daa5be1d01
2 changed files with 20 additions and 15 deletions

View File

@ -88,13 +88,13 @@ function set-linux-node-image() {
function set-windows-node-image() {
WINDOWS_NODE_IMAGE_PROJECT="windows-cloud"
if [[ "${WINDOWS_NODE_OS_DISTRIBUTION}" == "win2019" ]]; then
WINDOWS_NODE_IMAGE="windows-server-2019-dc-core-v20210112"
WINDOWS_NODE_IMAGE="windows-server-2019-dc-core-v20210413"
elif [[ "${WINDOWS_NODE_OS_DISTRIBUTION}" == "win1909" ]]; then
WINDOWS_NODE_IMAGE="windows-server-1909-dc-core-v20210112"
WINDOWS_NODE_IMAGE="windows-server-1909-dc-core-v20210413"
elif [[ "${WINDOWS_NODE_OS_DISTRIBUTION}" == "win2004" ]]; then
WINDOWS_NODE_IMAGE="windows-server-2004-dc-core-v20210112"
WINDOWS_NODE_IMAGE="windows-server-2004-dc-core-v20210413"
elif [[ "${WINDOWS_NODE_OS_DISTRIBUTION,,}" == "win20h2" ]]; then
WINDOWS_NODE_IMAGE="windows-server-20h2-dc-core-v20210112"
WINDOWS_NODE_IMAGE="windows-server-20h2-dc-core-v20210413"
else
echo "Unknown WINDOWS_NODE_OS_DISTRIBUTION ${WINDOWS_NODE_OS_DISTRIBUTION}" >&2
exit 1

View File

@ -126,19 +126,25 @@ try {
exit 0
}
if (-not (Test-DockerIsInstalled)) {
Install-Docker
}
# For some reason the docker service may not be started automatically on the
# first reboot, although it seems to work fine on subsequent reboots.
Restart-Service docker
Start-Sleep 5
if (-not (Test-DockerIsRunning)) {
throw "docker service failed to start or stay running"
$kube_env = Fetch-KubeEnv
Set-EnvironmentVars
# Install Docker if the select CRI is not containerd and docker is not already
# installed.
if (${env:CONTAINER_RUNTIME} -ne "containerd") {
if (-not (Test-DockerIsInstalled)) {
Install-Docker
}
# For some reason the docker service may not be started automatically on the
# first reboot, although it seems to work fine on subsequent reboots.
Restart-Service docker
Start-Sleep 5
if (-not (Test-DockerIsRunning)) {
throw "docker service failed to start or stay running"
}
}
Set-PrerequisiteOptions
$kube_env = Fetch-KubeEnv
if (Test-IsTestCluster $kube_env) {
Log-Output 'Test cluster detected, installing OpenSSH.'
@ -147,7 +153,6 @@ try {
StartProcess-WriteSshKeys
}
Set-EnvironmentVars
Create-Directories
Download-HelperScripts