Przeglądaj źródła

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 <kolyshkin@gmail.com>
Kir Kolyshkin 7 lat temu
rodzic
commit
6a2851332d
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      hack/make.ps1

+ 1 - 1
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] {