From 46d4c9fa40f6bce113f42bb46c4c7cbd426903f7 Mon Sep 17 00:00:00 2001 From: Matthias Diester Date: Thu, 22 Dec 2022 14:18:50 +0100 Subject: [PATCH] Bump to Go `1.19` Use Go `1.19` in all CI configurations. Update Go module Go version. Change Go version in README and samples. --- .github/workflows/check-latest-images.yaml | 2 +- .github/workflows/ci.yml | 6 +++--- .github/workflows/mirror-images.yaml | 1 + .github/workflows/nightly.yaml | 2 +- .github/workflows/release.yaml | 2 +- .github/workflows/verify.yaml | 2 +- HACK.md | 2 +- docs/buildstrategies.md | 2 +- go.mod | 2 +- pkg/client/clientset/versioned/fake/register.go | 14 +++++++------- pkg/client/clientset/versioned/scheme/register.go | 14 +++++++------- samples/build/build_ko_cr.yaml | 2 +- samples/buildstrategy/ko/buildstrategy_ko_cr.yaml | 2 +- 13 files changed, 27 insertions(+), 26 deletions(-) diff --git a/.github/workflows/check-latest-images.yaml b/.github/workflows/check-latest-images.yaml index aa2a0213ea..13595361ea 100644 --- a/.github/workflows/check-latest-images.yaml +++ b/.github/workflows/check-latest-images.yaml @@ -21,7 +21,7 @@ jobs: latest-release-url: https://api.github.com/repos/google/go-containerregistry/releases/latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Check and modify ${{ matrix.image }} env: IMAGE: ${{ matrix.image }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88e000803e..a5f89465a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: - name: Install Go uses: actions/setup-go@v3 with: - go-version: '1.18.x' + go-version: '1.19.x' cache: true check-latest: true - name: Build @@ -41,7 +41,7 @@ jobs: - name: Install Go uses: actions/setup-go@v3 with: - go-version: '1.18.x' + go-version: '1.19.x' cache: true check-latest: true - name: Install Ko @@ -103,7 +103,7 @@ jobs: - name: Install Go uses: actions/setup-go@v3 with: - go-version: '1.18.x' + go-version: '1.19.x' cache: true check-latest: true - name: Install kubectl diff --git a/.github/workflows/mirror-images.yaml b/.github/workflows/mirror-images.yaml index b8eec405de..31747bfe6f 100644 --- a/.github/workflows/mirror-images.yaml +++ b/.github/workflows/mirror-images.yaml @@ -21,6 +21,7 @@ jobs: library/golang:1.16 \ library/golang:1.17 \ library/golang:1.18 \ + library/golang:1.19 \ library/maven:3-jdk-8-openj9 \ library/node:12 \ library/node:14 \ diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 1baace564e..995cb00368 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: '1.18.x' + go-version: '1.19.x' cache: true check-latest: true diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index bf9ce040ca..c4059db807 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -30,7 +30,7 @@ jobs: fetch-depth: 0 # Fetch all history, needed for release note generation. - uses: actions/setup-go@v3 with: - go-version: '1.18.x' + go-version: '1.19.x' cache: true check-latest: true diff --git a/.github/workflows/verify.yaml b/.github/workflows/verify.yaml index 59c70c31dd..0c583b35e7 100644 --- a/.github/workflows/verify.yaml +++ b/.github/workflows/verify.yaml @@ -25,7 +25,7 @@ jobs: - name: Install Go uses: actions/setup-go@v3 with: - go-version: '1.18.x' + go-version: '1.19.x' cache: true check-latest: true cache-dependency-path: go/src/github.com/shipwright-io/build diff --git a/HACK.md b/HACK.md index ce94c6e695..ce1acf3514 100644 --- a/HACK.md +++ b/HACK.md @@ -41,7 +41,7 @@ In the near future, the above would be setup by the controller. make clean && make build ``` -* This project uses Golang 1.18+ and controller-gen v0.6.2. +* This project uses Golang 1.19+ and controller-gen v0.6.2. * The controllers create/watch Tekton objects. # Testing diff --git a/docs/buildstrategies.md b/docs/buildstrategies.md index b2d91abdeb..1f90fce7b4 100644 --- a/docs/buildstrategies.md +++ b/docs/buildstrategies.md @@ -201,7 +201,7 @@ The build strategy provides the following parameters that you can set in a Build | Parameter | Description | Default | | -- | -- | -- | | `go-flags` | Value for the GOFLAGS environment variable. | Empty | -| `go-version` | Version of Go, must match a tag from [the golang image](https://hub.docker.com/_/golang?tab=tags) | `1.18` | +| `go-version` | Version of Go, must match a tag from [the golang image](https://hub.docker.com/_/golang?tab=tags) | `1.19` | | `ko-version` | Version of ko, must be either `latest` for the newest release, or a [ko release name](https://github.com/ko-build/ko/releases) | `latest` | | `package-directory` | The directory inside the context directory containing the main package. | `.` | | `target-platform` | Target platform to be built. For example: `linux/arm64`. Multiple platforms can be provided separated by comma, for example: `linux/arm64,linux/amd64`. The value `all` will build all platforms supported by the base image. The value `current` will build the platform on which the build runs. | `current` | diff --git a/go.mod b/go.mod index 50c3ac5f97..a040a506f0 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/shipwright-io/build -go 1.18 +go 1.19 require ( github.com/docker/cli v20.10.22+incompatible diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 4c59e917cf..25c5329114 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -25,14 +25,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index 3e6e6a2104..4d7ee14b36 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -25,14 +25,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/samples/build/build_ko_cr.yaml b/samples/build/build_ko_cr.yaml index 7b495d7cfd..e0791800e3 100644 --- a/samples/build/build_ko_cr.yaml +++ b/samples/build/build_ko_cr.yaml @@ -10,7 +10,7 @@ spec: - name: go-flags value: "-v -mod=vendor -ldflags=-w" - name: go-version - value: "1.18" + value: "1.19" - name: package-directory value: ./cmd/shipwright-build-controller source: diff --git a/samples/buildstrategy/ko/buildstrategy_ko_cr.yaml b/samples/buildstrategy/ko/buildstrategy_ko_cr.yaml index 6b730b5277..9011c91aec 100644 --- a/samples/buildstrategy/ko/buildstrategy_ko_cr.yaml +++ b/samples/buildstrategy/ko/buildstrategy_ko_cr.yaml @@ -10,7 +10,7 @@ spec: default: "" - name: go-version description: "Version of Go, must match a tag from https://hub.docker.com/_/golang?tab=tags" - default: "1.18" + default: "1.19" - name: ko-version description: "Version of ko, must be either 'latest', or a release name from https://github.com/ko-build/ko/releases" default: latest