Skip to content

Commit

Permalink
CASMPET-5266: Bump go version to 1.17.6
Browse files Browse the repository at this point in the history
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 kubernetes-sigs/json#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
  • Loading branch information
Brant Knudson committed Jan 26, 2022
1 parent 57f7c2e commit c2001ec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions buildPrep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/k8sres.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ func generateContainer(
Command: command,
}

handler := &v1.Handler{
handler := &v1.LifecycleHandler{
Exec: execAction,
}

Expand Down

0 comments on commit c2001ec

Please sign in to comment.