From c2001ec070561e486d15bb567de84f10434fe282 Mon Sep 17 00:00:00 2001 From: Brant Knudson Date: Wed, 26 Jan 2022 08:25:46 -0600 Subject: [PATCH] CASMPET-5266: Bump go version to 1.17.6 The build doesn't work with go version 1.16.9. The build was failing with ``` [2022-01-25T22:54:22.534Z] vendor/sigs.k8s.io/json/internal/golang/encoding/json/encode.go:1249:12: sf.IsExported undefined (type reflect.StructField has no field or method IsExported) ``` Looking at bugs like https://github.com/kubernetes-sigs/json/issues/8 it says that go 1.16 is on its way out. The latest 1.17 is 1.17.6, see https://go.dev/doc/devel/release#go1.17.minor --- Makefile | 2 +- buildPrep.sh | 8 ++++---- pkg/cluster/k8sres.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 697b9f90..921c3617 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .PHONY: clean local test linux macos docker push scm-source.json e2e -GO_BINARY ?= /home/jenkins/go/bin/go1.16.9 +GO_BINARY ?= /home/jenkins/go/bin/go1.17.6 BINARY ?= postgres-operator BUILD_FLAGS ?= -v CGO_ENABLED ?= 0 diff --git a/buildPrep.sh b/buildPrep.sh index fbb07518..dad195c1 100755 --- a/buildPrep.sh +++ b/buildPrep.sh @@ -3,7 +3,7 @@ set -e -x export PATH=$PATH:/usr/local/go/bin export PATH=$PATH:/root/go/bin -rm -f go1.16.9.linux-amd64.tar* +rm -f go1.17.6.linux-amd64.tar* : "${GOPATH:=$HOME/go}" if which git ; then @@ -18,11 +18,11 @@ if which go ; then echo "Go is installed." else echo "Go wasn't installed, trying to install" - wget https://dl.google.com/go/go1.16.9.linux-amd64.tar.gz - tar -C /usr/local -xzf go1.16.9.linux-amd64.tar.gz + wget https://dl.google.com/go/go1.17.6.linux-amd64.tar.gz + tar -C /usr/local -xzf go1.17.6.linux-amd64.tar.gz fi -GO_VERSION="1.16.9" +GO_VERSION="1.17.6" INSTALLED_GO_VERSION=$(go version | awk '{print $3}') if [[ "go${GO_VERSION}" != $INSTALLED_GO_VERSION ]]; then diff --git a/pkg/cluster/k8sres.go b/pkg/cluster/k8sres.go index 8574bf23..c0e6ba63 100644 --- a/pkg/cluster/k8sres.go +++ b/pkg/cluster/k8sres.go @@ -470,7 +470,7 @@ func generateContainer( Command: command, } - handler := &v1.Handler{ + handler := &v1.LifecycleHandler{ Exec: execAction, }