From 6a77a792357cfc28a5984f0c2a9166c1b017cf92 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Fri, 3 Aug 2018 13:40:38 +0300 Subject: [PATCH] hack/make.ps1: don't use ENV GO_VERSION Modify hack/make.ps1 to use the version value used in "FROM golang" statement. While at it: 1. Make search expression a bit more strict (use ^ to match at BOL only). 2. Simplify by removing Get-Contents as Select-String can read files. After this, ENV GO_VERSION can be removed from Dockerfile. Unfortunately it can't be done in one commit as Windows CI fails (presumably because Dockerfile is being modified in place). Signed-off-by: Kir Kolyshkin Upstream-commit: 6a2851332d5f86bb61a69d277f663f369377037b Component: engine --- components/engine/hack/make.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/engine/hack/make.ps1 b/components/engine/hack/make.ps1 index e1e91e52c2..f15f8ef225 100644 --- a/components/engine/hack/make.ps1 +++ b/components/engine/hack/make.ps1 @@ -130,7 +130,7 @@ Function Check-InContainer() { # outside of a container where it may be out of date with master. Function Verify-GoVersion() { Try { - $goVersionDockerfile=(Get-Content ".\Dockerfile" | Select-String "ENV GO_VERSION").ToString().Split(" ")[2] + $goVersionDockerfile=(Select-String -Path ".\Dockerfile" -Pattern "^FROM golang:").ToString().Split(" ")[1].SubString(7) $goVersionInstalled=(go version).ToString().Split(" ")[2].SubString(2) } Catch [Exception] {