diff --git a/cluster/gce/config-common.sh b/cluster/gce/config-common.sh index e7dda920cd5..9622f268c61 100644 --- a/cluster/gce/config-common.sh +++ b/cluster/gce/config-common.sh @@ -159,4 +159,4 @@ export WINDOWS_BOOTSTRAP_KUBECONFIG_FILE="${WINDOWS_K8S_DIR}\kubelet.bootstrap-k # Path for kube-proxy kubeconfig file on Windows nodes. export WINDOWS_KUBEPROXY_KUBECONFIG_FILE="${WINDOWS_K8S_DIR}\kubeproxy.kubeconfig" # Pause container image for Windows container. -export WINDOWS_INFRA_CONTAINER="gcr.io/gke-release/pause-win:1.1.0" +export WINDOWS_INFRA_CONTAINER="gcr.io/gke-release/pause-win:1.2.0" diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index b3a941d8c82..3356fbb07f8 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -88,11 +88,11 @@ 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-for-containers-v20200114" + WINDOWS_NODE_IMAGE="windows-server-2019-dc-core-for-containers-v20200310" elif [[ "${WINDOWS_NODE_OS_DISTRIBUTION}" == "win1909" ]]; then - WINDOWS_NODE_IMAGE="windows-server-1909-dc-core-for-containers-v20200114" + WINDOWS_NODE_IMAGE="windows-server-1909-dc-core-for-containers-v20200310" elif [[ "${WINDOWS_NODE_OS_DISTRIBUTION}" == "win1809" ]]; then - WINDOWS_NODE_IMAGE="windows-server-1809-dc-core-for-containers-v20200114" + WINDOWS_NODE_IMAGE="windows-server-1809-dc-core-for-containers-v20200310" else echo "Unknown WINDOWS_NODE_OS_DISTRIBUTION ${WINDOWS_NODE_OS_DISTRIBUTION}" >&2 exit 1 diff --git a/cluster/gce/windows/k8s-node-setup.psm1 b/cluster/gce/windows/k8s-node-setup.psm1 index ae2788faaf9..b6efbc2f80f 100644 --- a/cluster/gce/windows/k8s-node-setup.psm1 +++ b/cluster/gce/windows/k8s-node-setup.psm1 @@ -135,11 +135,24 @@ function Add_GceMetadataServerRoute { } } +# Returns a PowerShell object representing the Windows version. +function Get_WindowsVersion { + # Unlike checking `[System.Environment]::OSVersion.Version`, this long-winded + # approach gets the OS revision/patch number correctly + # (https://superuser.com/a/1160428/652018). + $win_ver = New-Object -TypeName PSObject + $win_ver | Add-Member -MemberType NoteProperty -Name Major -Value $(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' CurrentMajorVersionNumber).CurrentMajorVersionNumber + $win_ver | Add-Member -MemberType NoteProperty -Name Minor -Value $(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' CurrentMinorVersionNumber).CurrentMinorVersionNumber + $win_ver | Add-Member -MemberType NoteProperty -Name Build -Value $(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' CurrentBuild).CurrentBuild + $win_ver | Add-Member -MemberType NoteProperty -Name Revision -Value $(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' UBR).UBR + return $win_ver +} + # Writes debugging information, such as Windows version and patch info, to the # console. function Dump-DebugInfoToConsole { Try { - $version = "$([System.Environment]::OSVersion.Version | Out-String)" + $version = Get_WindowsVersion | Out-String $hotfixes = "$(Get-Hotfix | Out-String)" $image = "$(Get-InstanceMetadata 'image' | Out-String)" Log-Output "Windows version:`n$version" diff --git a/cluster/gce/windows/smoke-test.sh b/cluster/gce/windows/smoke-test.sh index 9e9bb38492e..ddbed62d68a 100755 --- a/cluster/gce/windows/smoke-test.sh +++ b/cluster/gce/windows/smoke-test.sh @@ -358,7 +358,7 @@ spec: spec: containers: - name: pause-win - image: gcr.io/gke-release/pause-win:1.1.0 + image: gcr.io/gke-release/pause-win:1.2.0 nodeSelector: kubernetes.io/os: windows tolerations: