From 650036d5d3e94b5a8937e86a696c6eec50d77a26 Mon Sep 17 00:00:00 2001 From: Camila Macedo Date: Fri, 26 Jan 2024 11:48:08 +0000 Subject: [PATCH] :sparkles: Add support to go 1.21 --- .github/workflows/apidiff.yml | 2 +- .github/workflows/lint-sample.yml | 4 ++-- .github/workflows/lint.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/test-sample-go.yml | 2 +- .github/workflows/testdata.yml | 2 +- .github/workflows/unit-tests.yml | 4 ++-- CONTRIBUTING.md | 2 +- docs/book/book.toml | 4 ++-- .../component-config-tutorial/testdata/project/Dockerfile | 2 +- .../component-config-tutorial/testdata/project/README.md | 2 +- .../src/component-config-tutorial/testdata/project/go.mod | 2 +- .../src/component-config-tutorial/testdata/project/go.sum | 7 +++++++ docs/book/src/cronjob-tutorial/testdata/project/Dockerfile | 2 +- docs/book/src/cronjob-tutorial/testdata/project/README.md | 2 +- docs/book/src/cronjob-tutorial/testdata/project/go.mod | 2 +- docs/book/src/cronjob-tutorial/testdata/project/go.sum | 7 +++++++ .../testdata/sampleexternalplugin/v1/go.mod | 2 +- go.mod | 2 +- go.sum | 3 +++ pkg/plugins/golang/go_version_test.go | 1 + .../golang/v4/scaffolds/internal/templates/dockerfile.go | 2 +- .../golang/v4/scaffolds/internal/templates/gomod.go | 2 +- .../golang/v4/scaffolds/internal/templates/readme.go | 2 +- test/common.sh | 2 +- .../project-v4-multigroup-with-deploy-image/Dockerfile | 2 +- testdata/project-v4-multigroup-with-deploy-image/README.md | 2 +- testdata/project-v4-multigroup-with-deploy-image/go.mod | 2 +- testdata/project-v4-multigroup/Dockerfile | 2 +- testdata/project-v4-multigroup/README.md | 2 +- testdata/project-v4-multigroup/go.mod | 2 +- testdata/project-v4-with-deploy-image/Dockerfile | 2 +- testdata/project-v4-with-deploy-image/README.md | 2 +- testdata/project-v4-with-deploy-image/go.mod | 2 +- testdata/project-v4-with-grafana/Dockerfile | 2 +- testdata/project-v4-with-grafana/README.md | 2 +- testdata/project-v4-with-grafana/go.mod | 2 +- testdata/project-v4/Dockerfile | 2 +- testdata/project-v4/README.md | 2 +- testdata/project-v4/go.mod | 2 +- 40 files changed, 57 insertions(+), 39 deletions(-) diff --git a/.github/workflows/apidiff.yml b/.github/workflows/apidiff.yml index 9bfe8fc2a58..e0d869fb6e7 100644 --- a/.github/workflows/apidiff.yml +++ b/.github/workflows/apidiff.yml @@ -19,7 +19,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: "~1.20" + go-version: "~1.21" - name: Execute go-apidiff uses: joelanford/go-apidiff@v0.8.2 with: diff --git a/.github/workflows/lint-sample.yml b/.github/workflows/lint-sample.yml index 86ce6993912..669e3cb7aa4 100644 --- a/.github/workflows/lint-sample.yml +++ b/.github/workflows/lint-sample.yml @@ -17,7 +17,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: '~1.20' + go-version: '~1.21' - name: Remove pre-installed kustomize run: sudo rm -f /usr/local/bin/kustomize - name: Run make test for project-v4-with-deploy-image @@ -34,7 +34,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: '~1.20' + go-version: '~1.21' - name: Clone the code uses: actions/checkout@v4 - name: Run linter diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 266ba3dda43..b37b3c8ef95 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,7 +15,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: '~1.20' + go-version: '~1.21' - name: Clone the code uses: actions/checkout@v4 - name: Run linter diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ff7c9f9af46..db0ed918dfd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '~1.20' + go-version: '~1.21' - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 with: diff --git a/.github/workflows/test-sample-go.yml b/.github/workflows/test-sample-go.yml index af3f55bd890..2c348a39c35 100644 --- a/.github/workflows/test-sample-go.yml +++ b/.github/workflows/test-sample-go.yml @@ -19,7 +19,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: '~1.20' + go-version: '~1.21' - name: Install Kind run: go install sigs.k8s.io/kind@v$kind_version diff --git a/.github/workflows/testdata.yml b/.github/workflows/testdata.yml index 50ae868b2a3..6b45956b7d2 100644 --- a/.github/workflows/testdata.yml +++ b/.github/workflows/testdata.yml @@ -18,7 +18,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: '~1.20' + go-version: '~1.21' - name: Remove pre-installed kustomize # This step is needed as the following one tries to remove # kustomize for each test but has no permission to do so diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index a2ff04453c3..d69bc9d26f0 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -22,7 +22,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: '~1.20' + go-version: '~1.21' # This step is needed as the following one tries to remove # kustomize for each test but has no permission to do so - name: Remove pre-installed kustomize @@ -52,7 +52,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.21" - name: Generate the coverage output run: make test-coverage - name: Send the coverage output diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 46028d1a1b5..c649b4c0ec8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ Please see https://git.k8s.io/community/CLA.md for more info. ## Prerequisites -- [go](https://golang.org/dl/) version v1.20+. +- [go](https://golang.org/dl/) version v1.21+. - [docker](https://docs.docker.com/install/) version 17.03+. - [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) version v1.11.3+. - [kustomize](https://github.com/kubernetes-sigs/kustomize/blob/master/site/content/en/docs/Getting%20started/installation.md) v3.1.0+ diff --git a/docs/book/book.toml b/docs/book/book.toml index 557e903a20c..0dad9b4092c 100644 --- a/docs/book/book.toml +++ b/docs/book/book.toml @@ -17,8 +17,8 @@ command = "./litgo.sh" command = "./markerdocs.sh" [context.environment] - environment = { GO_VERSION = "1.20" } + environment = { GO_VERSION = "1.21" } [context.deploy-preview.environment] - environment = { GO_VERSION = "1.20" } + environment = { GO_VERSION = "1.21" } diff --git a/docs/book/src/component-config-tutorial/testdata/project/Dockerfile b/docs/book/src/component-config-tutorial/testdata/project/Dockerfile index b078298da3b..aca26f92295 100644 --- a/docs/book/src/component-config-tutorial/testdata/project/Dockerfile +++ b/docs/book/src/component-config-tutorial/testdata/project/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.20 AS builder +FROM golang:1.21 AS builder ARG TARGETOS ARG TARGETARCH diff --git a/docs/book/src/component-config-tutorial/testdata/project/README.md b/docs/book/src/component-config-tutorial/testdata/project/README.md index 30efdde08ee..a784c09d9d9 100644 --- a/docs/book/src/component-config-tutorial/testdata/project/README.md +++ b/docs/book/src/component-config-tutorial/testdata/project/README.md @@ -7,7 +7,7 @@ ## Getting Started ### Prerequisites -- go version v1.20.0+ +- go version v1.21.0+ - docker version 17.03+. - kubectl version v1.11.3+. - Access to a Kubernetes v1.11.3+ cluster. diff --git a/docs/book/src/component-config-tutorial/testdata/project/go.mod b/docs/book/src/component-config-tutorial/testdata/project/go.mod index a5c7dbda4f0..d460c7ed461 100644 --- a/docs/book/src/component-config-tutorial/testdata/project/go.mod +++ b/docs/book/src/component-config-tutorial/testdata/project/go.mod @@ -1,6 +1,6 @@ module tutorial.kubebuilder.io/project -go 1.20 +go 1.21 require ( github.com/onsi/ginkgo/v2 v2.11.0 diff --git a/docs/book/src/component-config-tutorial/testdata/project/go.sum b/docs/book/src/component-config-tutorial/testdata/project/go.sum index 8e8882fc771..c93be16cbec 100644 --- a/docs/book/src/component-config-tutorial/testdata/project/go.sum +++ b/docs/book/src/component-config-tutorial/testdata/project/go.sum @@ -1,5 +1,6 @@ github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= +github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= @@ -14,6 +15,7 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= +github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= @@ -65,6 +67,7 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -98,6 +101,7 @@ github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -110,12 +114,14 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= @@ -132,6 +138,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= +golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= diff --git a/docs/book/src/cronjob-tutorial/testdata/project/Dockerfile b/docs/book/src/cronjob-tutorial/testdata/project/Dockerfile index b078298da3b..aca26f92295 100644 --- a/docs/book/src/cronjob-tutorial/testdata/project/Dockerfile +++ b/docs/book/src/cronjob-tutorial/testdata/project/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.20 AS builder +FROM golang:1.21 AS builder ARG TARGETOS ARG TARGETARCH diff --git a/docs/book/src/cronjob-tutorial/testdata/project/README.md b/docs/book/src/cronjob-tutorial/testdata/project/README.md index 30efdde08ee..a784c09d9d9 100644 --- a/docs/book/src/cronjob-tutorial/testdata/project/README.md +++ b/docs/book/src/cronjob-tutorial/testdata/project/README.md @@ -7,7 +7,7 @@ ## Getting Started ### Prerequisites -- go version v1.20.0+ +- go version v1.21.0+ - docker version 17.03+. - kubectl version v1.11.3+. - Access to a Kubernetes v1.11.3+ cluster. diff --git a/docs/book/src/cronjob-tutorial/testdata/project/go.mod b/docs/book/src/cronjob-tutorial/testdata/project/go.mod index 3881d7d0e7a..bb2f22304d0 100644 --- a/docs/book/src/cronjob-tutorial/testdata/project/go.mod +++ b/docs/book/src/cronjob-tutorial/testdata/project/go.mod @@ -1,6 +1,6 @@ module tutorial.kubebuilder.io/project -go 1.20 +go 1.21 require ( github.com/onsi/ginkgo/v2 v2.11.0 diff --git a/docs/book/src/cronjob-tutorial/testdata/project/go.sum b/docs/book/src/cronjob-tutorial/testdata/project/go.sum index feb932492cd..61dd243ea1a 100644 --- a/docs/book/src/cronjob-tutorial/testdata/project/go.sum +++ b/docs/book/src/cronjob-tutorial/testdata/project/go.sum @@ -1,5 +1,6 @@ github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= +github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= @@ -14,6 +15,7 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= +github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= @@ -65,6 +67,7 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -100,6 +103,7 @@ github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPH github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ= github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -112,12 +116,14 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= @@ -134,6 +140,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= +golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= diff --git a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod index 7614023d7ab..1f6b79a90cd 100644 --- a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod +++ b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod @@ -1,6 +1,6 @@ module v1 -go 1.20 +go 1.21 require ( github.com/spf13/pflag v1.0.5 diff --git a/go.mod b/go.mod index 8576970d146..111531a513f 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module sigs.k8s.io/kubebuilder/v3 -go 1.20 +go 1.21 require ( github.com/gobuffalo/flect v1.0.2 diff --git a/go.sum b/go.sum index 7151c486ded..b268951a91f 100644 --- a/go.sum +++ b/go.sum @@ -9,6 +9,7 @@ github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4 github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA= github.com/gobuffalo/flect v1.0.2/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -45,6 +46,7 @@ golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= @@ -53,6 +55,7 @@ golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/plugins/golang/go_version_test.go b/pkg/plugins/golang/go_version_test.go index 5f388afcdce..f67e40728f9 100644 --- a/pkg/plugins/golang/go_version_test.go +++ b/pkg/plugins/golang/go_version_test.go @@ -198,6 +198,7 @@ var _ = Describe("checkGoVersion", func() { Entry("for go.1.19", "go1.19"), Entry("for go.1.19.1", "go1.19.1"), Entry("for go.1.20", "go1.20"), + Entry("for go.1.21", "go1.21"), ) DescribeTable("should return an error for non-supported go versions", diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/dockerfile.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/dockerfile.go index 6e0b29c6073..30ab49d148e 100644 --- a/pkg/plugins/golang/v4/scaffolds/internal/templates/dockerfile.go +++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/dockerfile.go @@ -39,7 +39,7 @@ func (f *Dockerfile) SetTemplateDefaults() error { } const dockerfileTemplate = `# Build the manager binary -FROM golang:1.20 AS builder +FROM golang:1.21 AS builder ARG TARGETOS ARG TARGETARCH diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/gomod.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/gomod.go index 18e4a19fa3f..c1860c1a9f1 100644 --- a/pkg/plugins/golang/v4/scaffolds/internal/templates/gomod.go +++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/gomod.go @@ -46,7 +46,7 @@ func (f *GoMod) SetTemplateDefaults() error { const goModTemplate = ` module {{ .Repo }} -go 1.20 +go 1.21 require ( sigs.k8s.io/controller-runtime {{ .ControllerRuntimeVersion }} diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/readme.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/readme.go index 9131e849bf1..b95840a5ab9 100644 --- a/pkg/plugins/golang/v4/scaffolds/internal/templates/readme.go +++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/readme.go @@ -66,7 +66,7 @@ const readmeFileTemplate = `# {{ .ProjectName }} ## Getting Started ### Prerequisites -- go version v1.20.0+ +- go version v1.21.0+ - docker version 17.03+. - kubectl version v1.11.3+. - Access to a Kubernetes v1.11.3+ cluster. diff --git a/test/common.sh b/test/common.sh index 5f4ecbea58c..14b3475837a 100644 --- a/test/common.sh +++ b/test/common.sh @@ -23,7 +23,7 @@ function convert_to_tools_ver { # 1.14-1.19 work with the 1.19 server bins and kubectl. "1.14"|"1.15"|"1.16"|"1.17"|"1.18"|"1.19") echo "1.19.2";; # Tests in 1.20 and 1.21 with their counterpart version's apiserver. - "1.20"|"1.21") echo "1.19.2";; + "1.20"|"1.21") echo "1.21.5";; "1.22") echo "1.22.1";; "1.23") echo "1.23.3";; "1.24") echo "1.24.1";; diff --git a/testdata/project-v4-multigroup-with-deploy-image/Dockerfile b/testdata/project-v4-multigroup-with-deploy-image/Dockerfile index b078298da3b..aca26f92295 100644 --- a/testdata/project-v4-multigroup-with-deploy-image/Dockerfile +++ b/testdata/project-v4-multigroup-with-deploy-image/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.20 AS builder +FROM golang:1.21 AS builder ARG TARGETOS ARG TARGETARCH diff --git a/testdata/project-v4-multigroup-with-deploy-image/README.md b/testdata/project-v4-multigroup-with-deploy-image/README.md index 0cebb8c9b11..46bca5eb056 100644 --- a/testdata/project-v4-multigroup-with-deploy-image/README.md +++ b/testdata/project-v4-multigroup-with-deploy-image/README.md @@ -7,7 +7,7 @@ ## Getting Started ### Prerequisites -- go version v1.20.0+ +- go version v1.21.0+ - docker version 17.03+. - kubectl version v1.11.3+. - Access to a Kubernetes v1.11.3+ cluster. diff --git a/testdata/project-v4-multigroup-with-deploy-image/go.mod b/testdata/project-v4-multigroup-with-deploy-image/go.mod index 58bfe7fdfa5..cc31367009d 100644 --- a/testdata/project-v4-multigroup-with-deploy-image/go.mod +++ b/testdata/project-v4-multigroup-with-deploy-image/go.mod @@ -1,6 +1,6 @@ module sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image -go 1.20 +go 1.21 require ( github.com/onsi/ginkgo/v2 v2.11.0 diff --git a/testdata/project-v4-multigroup/Dockerfile b/testdata/project-v4-multigroup/Dockerfile index b078298da3b..aca26f92295 100644 --- a/testdata/project-v4-multigroup/Dockerfile +++ b/testdata/project-v4-multigroup/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.20 AS builder +FROM golang:1.21 AS builder ARG TARGETOS ARG TARGETARCH diff --git a/testdata/project-v4-multigroup/README.md b/testdata/project-v4-multigroup/README.md index 9750cc09755..74f98f91fbc 100644 --- a/testdata/project-v4-multigroup/README.md +++ b/testdata/project-v4-multigroup/README.md @@ -7,7 +7,7 @@ ## Getting Started ### Prerequisites -- go version v1.20.0+ +- go version v1.21.0+ - docker version 17.03+. - kubectl version v1.11.3+. - Access to a Kubernetes v1.11.3+ cluster. diff --git a/testdata/project-v4-multigroup/go.mod b/testdata/project-v4-multigroup/go.mod index ff8993bdb38..a64452926a9 100644 --- a/testdata/project-v4-multigroup/go.mod +++ b/testdata/project-v4-multigroup/go.mod @@ -1,6 +1,6 @@ module sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup -go 1.20 +go 1.21 require ( github.com/onsi/ginkgo/v2 v2.11.0 diff --git a/testdata/project-v4-with-deploy-image/Dockerfile b/testdata/project-v4-with-deploy-image/Dockerfile index b078298da3b..aca26f92295 100644 --- a/testdata/project-v4-with-deploy-image/Dockerfile +++ b/testdata/project-v4-with-deploy-image/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.20 AS builder +FROM golang:1.21 AS builder ARG TARGETOS ARG TARGETARCH diff --git a/testdata/project-v4-with-deploy-image/README.md b/testdata/project-v4-with-deploy-image/README.md index ddfdcf17424..a33bbeb35c3 100644 --- a/testdata/project-v4-with-deploy-image/README.md +++ b/testdata/project-v4-with-deploy-image/README.md @@ -7,7 +7,7 @@ ## Getting Started ### Prerequisites -- go version v1.20.0+ +- go version v1.21.0+ - docker version 17.03+. - kubectl version v1.11.3+. - Access to a Kubernetes v1.11.3+ cluster. diff --git a/testdata/project-v4-with-deploy-image/go.mod b/testdata/project-v4-with-deploy-image/go.mod index 5eb658ea40d..df1a3327d70 100644 --- a/testdata/project-v4-with-deploy-image/go.mod +++ b/testdata/project-v4-with-deploy-image/go.mod @@ -1,6 +1,6 @@ module sigs.k8s.io/kubebuilder/testdata/project-v4-with-deploy-image -go 1.20 +go 1.21 require ( github.com/onsi/ginkgo/v2 v2.11.0 diff --git a/testdata/project-v4-with-grafana/Dockerfile b/testdata/project-v4-with-grafana/Dockerfile index b078298da3b..aca26f92295 100644 --- a/testdata/project-v4-with-grafana/Dockerfile +++ b/testdata/project-v4-with-grafana/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.20 AS builder +FROM golang:1.21 AS builder ARG TARGETOS ARG TARGETARCH diff --git a/testdata/project-v4-with-grafana/README.md b/testdata/project-v4-with-grafana/README.md index b9834dd416e..33fa936d88d 100644 --- a/testdata/project-v4-with-grafana/README.md +++ b/testdata/project-v4-with-grafana/README.md @@ -7,7 +7,7 @@ ## Getting Started ### Prerequisites -- go version v1.20.0+ +- go version v1.21.0+ - docker version 17.03+. - kubectl version v1.11.3+. - Access to a Kubernetes v1.11.3+ cluster. diff --git a/testdata/project-v4-with-grafana/go.mod b/testdata/project-v4-with-grafana/go.mod index 2136780a597..2c131c511a6 100644 --- a/testdata/project-v4-with-grafana/go.mod +++ b/testdata/project-v4-with-grafana/go.mod @@ -1,6 +1,6 @@ module sigs.k8s.io/kubebuilder/testdata/project-v4-with-grafana -go 1.20 +go 1.21 require ( github.com/onsi/ginkgo/v2 v2.11.0 diff --git a/testdata/project-v4/Dockerfile b/testdata/project-v4/Dockerfile index b078298da3b..aca26f92295 100644 --- a/testdata/project-v4/Dockerfile +++ b/testdata/project-v4/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.20 AS builder +FROM golang:1.21 AS builder ARG TARGETOS ARG TARGETARCH diff --git a/testdata/project-v4/README.md b/testdata/project-v4/README.md index a4469cad252..e19b6645613 100644 --- a/testdata/project-v4/README.md +++ b/testdata/project-v4/README.md @@ -7,7 +7,7 @@ ## Getting Started ### Prerequisites -- go version v1.20.0+ +- go version v1.21.0+ - docker version 17.03+. - kubectl version v1.11.3+. - Access to a Kubernetes v1.11.3+ cluster. diff --git a/testdata/project-v4/go.mod b/testdata/project-v4/go.mod index 4143150efe8..508754f5f65 100644 --- a/testdata/project-v4/go.mod +++ b/testdata/project-v4/go.mod @@ -1,6 +1,6 @@ module sigs.k8s.io/kubebuilder/testdata/project-v4 -go 1.20 +go 1.21 require ( github.com/onsi/ginkgo/v2 v2.11.0