Skip to content

Commit

Permalink
chore: Upgrade Go tool chain version 1.19 to version 1.20 (#1788)
Browse files Browse the repository at this point in the history
Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
Co-authored-by: ErMao <g1561925068@163.com>
Co-authored-by: Jintao Zhang <zhangjintao9020@gmail.com>
  • Loading branch information
3 people authored Aug 4, 2023
1 parent 3fa789d commit 37e9201
Show file tree
Hide file tree
Showing 16 changed files with 27 additions and 66 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/e2e-test-ci-v2-cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
id: go
uses: actions/setup-go@v3 # v3.2.0
with:
go-version: '1.19'
go-version: '1.20'

- name: Set up QEMU
uses: docker/setup-qemu-action@v2 #v2.0.0
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:
- name: Setup Go Env
uses: actions/setup-go@v3
with:
go-version: "1.19"
go-version: "1.20"

- name: Install ginkgo
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-test-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
id: go
uses: actions/setup-go@v3 # v3.2.0
with:
go-version: '1.19'
go-version: '1.20'

- name: Set up QEMU
uses: docker/setup-qemu-action@v2 #v2.0.0
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:
- name: Setup Go Env
uses: actions/setup-go@v3
with:
go-version: "1.19"
go-version: "1.20"

- name: Install ginkgo
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/goimports-reviser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Setup Go Env
uses: actions/setup-go@v3
with:
go-version: "1.19"
go-version: "1.20"
- name: Make update-gofmt
working-directory: ./
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ jobs:
- name: Setup Go Env
uses: actions/setup-go@v3
with:
go-version: '1.19'
go-version: '1.20'

- name: Download golangci-lint
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.49.0
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.52.2

- name: 🛩️ golangci-lint
run: $(go env GOPATH)/bin/golangci-lint run --tests=false --timeout 300s ./...
4 changes: 2 additions & 2 deletions .github/workflows/k8s-timer-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
id: go
uses: actions/setup-go@v3 # v3.2.0
with:
go-version: '1.19'
go-version: '1.20'

- name: Set up QEMU
uses: docker/setup-qemu-action@v2 #v2.0.0
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
- name: Setup Go Env
uses: actions/setup-go@v3
with:
go-version: "1.19"
go-version: "1.20"

- name: Install ginkgo
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
- name: Setup Go Env
uses: actions/setup-go@v3
with:
go-version: '1.19'
go-version: '1.20'
- name: run gofmt
working-directory: ./
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
- name: Setup Go Env
uses: actions/setup-go@v3
with:
go-version: "1.19"
go-version: "1.20"
- name: Run unit test
working-directory: ./
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify-codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Setup Go Env
uses: actions/setup-go@v3
with:
go-version: "1.19"
go-version: "1.20"
- name: Make verify-codegen
working-directory: ./
run: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
FROM golang:1.19 AS build-env
FROM golang:1.20 AS build-env
LABEL maintainer="gxthrj@163.com"

ARG ENABLE_PROXY=false
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ E2E_ENV ?= "dev"
### build: Build apisix-ingress-controller
.PHONY: build
build:
go build \
CGO_ENABLED=0 go build \
-o apisix-ingress-controller \
-ldflags $(GO_LDFLAGS) \
main.go
Expand Down
2 changes: 1 addition & 1 deletion docs/en/latest/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ This document walks through how you can set up your development environment to c

Before you get started make sure you have:

1. Installed [Go 1.19](https://golang.org/dl/) or later
1. Installed [Go 1.20](https://golang.org/dl/) or later
2. A Kubernetes cluster available. We recommend using [kind](https://kind.sigs.k8s.io/).
3. Installed APISIX in Kubernetes using [Helm](https://github.com/apache/apisix-helm-chart).

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/apache/apisix-ingress-controller

go 1.19
go 1.20

require (
github.com/gin-gonic/gin v1.9.1
Expand Down
File renamed without changes.
39 changes: 0 additions & 39 deletions pkg/utils/s2b_old.go

This file was deleted.

2 changes: 1 addition & 1 deletion test/e2e/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/apache/apisix-ingress-controller/test/e2e

go 1.19
go 1.20

require (
github.com/apache/apisix-ingress-controller v0.0.0-20210105024109-72e53386de5a
Expand Down
20 changes: 10 additions & 10 deletions test/e2e/suite-annotations/redirect.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: apisix
k8s.apisix.apache.org/http-redirect: "https://httpbin.org/get"
k8s.apisix.apache.org/http-redirect: "https://httpbun.org/get"
k8s.apisix.apache.org/http-redirect-code: "308"
name: ingress-v1
spec:
rules:
- host: httpbin.org
- host: httpbun.org
http:
paths:
- path: /*
Expand All @@ -183,12 +183,12 @@ spec:
assert.Nil(ginkgo.GinkgoT(), err, "creating ingress")
time.Sleep(5 * time.Second)

resp := s.NewAPISIXClient().GET("/ip").WithHeader("Host", "httpbin.org").Expect()
resp := s.NewAPISIXClient().GET("/ip").WithHeader("Host", "httpbun.org").Expect()
resp.Status(http.StatusPermanentRedirect)
url := resp.Header("Location").Equal("https://httpbin.org/get").Raw()
url := resp.Header("Location").Equal("https://httpbun.org/get").Raw()

body := httpexpect.New(ginkgo.GinkgoT(), url).GET("").Expect().Status(http.StatusOK).Body().Raw()
assert.Contains(ginkgo.GinkgoT(), body, "https://httpbin.org/get")
assert.Contains(ginkgo.GinkgoT(), body, "https://httpbun.org/get")
})

ginkgo.It("redirect http-redirect external link in ingress networking/v1beta1", func() {
Expand All @@ -199,12 +199,12 @@ kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: apisix
k8s.apisix.apache.org/http-redirect: "https://httpbin.org/get"
k8s.apisix.apache.org/http-redirect: "https://httpbun.org/get"
k8s.apisix.apache.org/http-redirect-code: "308"
name: ingress-v1beta1
spec:
rules:
- host: httpbin.org
- host: httpbun.org
http:
paths:
- path: /*
Expand All @@ -217,11 +217,11 @@ spec:
assert.Nil(ginkgo.GinkgoT(), err, "creating ingress")
time.Sleep(5 * time.Second)

resp := s.NewAPISIXClient().GET("/ip").WithHeader("Host", "httpbin.org").Expect()
resp := s.NewAPISIXClient().GET("/ip").WithHeader("Host", "httpbun.org").Expect()
resp.Status(http.StatusPermanentRedirect)
url := resp.Header("Location").Equal("https://httpbin.org/get").Raw()
url := resp.Header("Location").Equal("https://httpbun.org/get").Raw()

body := httpexpect.New(ginkgo.GinkgoT(), url).GET("").Expect().Status(http.StatusOK).Body().Raw()
assert.Contains(ginkgo.GinkgoT(), body, "https://httpbin.org/get")
assert.Contains(ginkgo.GinkgoT(), body, "https://httpbun.org/get")
})
})

0 comments on commit 37e9201

Please sign in to comment.