From 61450a651ba8fe4ef3cac284482a9495fc0b761d Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 6 Sep 2019 02:57:58 +0200 Subject: [PATCH] hack/ci/windows.ps1: fix Go version check (due to trailing .0) The Windows Dockerfile downloads the Go binaries, which (unlike the Golang images) do not have a trailing `.0` in their version. Signed-off-by: Sebastiaan van Stijn --- Dockerfile.windows | 3 ++- hack/make.ps1 | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile.windows b/Dockerfile.windows index 613a2513f7..363c0e1318 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -214,7 +214,8 @@ RUN ` Download-File $location C:\gitsetup.zip; ` ` Write-Host INFO: Downloading go...; ` - Download-File $('https://golang.org/dl/go'+$Env:GO_VERSION.TrimEnd('.0')"+'.windows-amd64.zip') C:\go.zip; ` + $dlGoVersion=$Env:GO_VERSION -replace '\.0$',''; ` + Download-File "https://golang.org/dl/go${dlGoVersion}.windows-amd64.zip" C:\go.zip; ` ` Write-Host INFO: Downloading compiler 1 of 3...; ` Download-File https://raw.githubusercontent.com/jhowardmsft/docker-tdmgcc/master/gcc.zip C:\gcc.zip; ` diff --git a/hack/make.ps1 b/hack/make.ps1 index 63fdbb32ad..e8ea35d798 100644 --- a/hack/make.ps1 +++ b/hack/make.ps1 @@ -134,7 +134,7 @@ Function Check-InContainer() { # outside of a container where it may be out of date with master. Function Verify-GoVersion() { Try { - $goVersionDockerfile=(Select-String -Path ".\Dockerfile" -Pattern "^ARG[\s]+GO_VERSION=(.*)$").Matches.groups[1].Value.TrimEnd(".0") + $goVersionDockerfile=(Select-String -Path ".\Dockerfile" -Pattern "^ARG[\s]+GO_VERSION=(.*)$").Matches.groups[1].Value -replace '\.0$','' $goVersionInstalled=(go version).ToString().Split(" ")[2].SubString(2) } Catch [Exception] {