diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml index 09b1eb50e..1a0f27ee6 100644 --- a/.github/workflows/linter.yaml +++ b/.github/workflows/linter.yaml @@ -20,14 +20,14 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.19 + go-version: 1.21 - name: check out code uses: actions/checkout@v3 - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: v1.50.1 + version: v1.55.2 # Optional: golangci-lint command line arguments. args: --verbose --timeout=5m diff --git a/.github/workflows/release_nightly.yaml b/.github/workflows/release_nightly.yaml index 740c35075..23ba6364b 100644 --- a/.github/workflows/release_nightly.yaml +++ b/.github/workflows/release_nightly.yaml @@ -20,7 +20,7 @@ jobs: - name: Install Go uses: actions/setup-go@v3 with: - go-version: 1.19.x + go-version: 1.21.x - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml index de94790de..26041ec94 100644 --- a/.github/workflows/run_tests.yaml +++ b/.github/workflows/run_tests.yaml @@ -62,7 +62,7 @@ jobs: - name: Install Go uses: actions/setup-go@v3 with: - go-version: 1.19.x + go-version: 1.21.x - name: Cache Go Modules uses: actions/cache@v3 diff --git a/.golangci.yml b/.golangci.yml index 402b4a2c4..24171ef12 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -40,7 +40,7 @@ linters-settings: extra-rules: true # Select the Go version to target. - lang-version: "1.19" + lang-version: "1.21" lll: # Max line length; lines longer will be reported diff --git a/CHANGELOG.md b/CHANGELOG.md index f29a082c2..f947f1607 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ - Added `tyk` to `categories` field of CRDs. So, from now on, all CRs related to Tyk Operator is grouped into `tyk` category and can be displayed via `kubectl get tyk`. +**Updated** +- Updated Go version to 1.21 + ## [v0.15.1](https://github.com/TykTechnologies/tyk-operator/tree/v0.15.1) [Full Changelog](https://github.com/TykTechnologies/tyk-operator/compare/v0.15.0...v0.15.1) diff --git a/Dockerfile b/Dockerfile index 51be2769e..180f8db5f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.19 as builder +FROM golang:1.21 as builder WORKDIR /workspace # Copy the Go Modules manifests diff --git a/controllers/ingress_controller_test.go b/controllers/ingress_controller_test.go index 21f8fb28c..87a949195 100644 --- a/controllers/ingress_controller_test.go +++ b/controllers/ingress_controller_test.go @@ -64,6 +64,8 @@ func TestBuildAPIName(t *testing.T) { } for n, tc := range tests { + tc := tc + t.Run(n, func(t *testing.T) { t.Parallel() result := reconciler.buildAPIName(tc.Namespace, tc.Name, tc.Hash) diff --git a/controllers/operatorcontext_controller_test.go b/controllers/operatorcontext_controller_test.go index 4cd9e6366..ce87dc9a1 100644 --- a/controllers/operatorcontext_controller_test.go +++ b/controllers/operatorcontext_controller_test.go @@ -125,6 +125,8 @@ func TestOperatorContextDelete(t *testing.T) { } for n, tc := range tests { + tc := tc + t.Run(n, func(t *testing.T) { t.Parallel() diff --git a/go.mod b/go.mod index 319b47227..25f5fa3ce 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/TykTechnologies/tyk-operator -go 1.19 +go 1.21 require ( github.com/TykTechnologies/graphql-go-tools v1.6.2-0.20221207092329-acdd20d63048 diff --git a/go.sum b/go.sum index 22a99c5cb..27c57786a 100644 --- a/go.sum +++ b/go.sum @@ -888,6 +888,7 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=