Skip to content

Commit

Permalink
upgrade go 1.21.5 (#10732)
Browse files Browse the repository at this point in the history
* upgrade go 1.21.5

Signed-off-by: James Strong <[email protected]>

* update golang gha

Signed-off-by: James Strong <[email protected]>

* supgrade golang lint ci to v1.55.2

* sfix all golang lint ci errors

* sget a nginx build as well

* srevert some e2e changes

* srevert some e2e changes

---------

Signed-off-by: James Strong <[email protected]>
  • Loading branch information
strongjz authored Dec 8, 2023
1 parent 6152695 commit 6807537
Show file tree
Hide file tree
Showing 26 changed files with 41 additions and 29 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ jobs:

- name: Set up Go
id: go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: '1.21.3'
go-version: '1.21.5'
check-latest: true

- name: Run test
Expand All @@ -94,9 +94,9 @@ jobs:

- name: Set up Go
id: go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: '1.21.3'
go-version: '1.21.5'
check-latest: true

- name: Set up QEMU
Expand Down Expand Up @@ -158,9 +158,9 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Setup Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: '1.21.3'
go-version: '1.21.5'
check-latest: true

- name: Install Helm Unit Test Plugin
Expand Down Expand Up @@ -508,9 +508,9 @@ jobs:
- name: Set up Go
id: go
if: ${{ steps.filter-images.outputs.kube-webhook-certgen == 'true' }}
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: '1.21.3'
go-version: '1.21.5'
check-latest: true

- name: kube-webhook-certgen image build
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:

- name: Set up Go
id: go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: '1.21.3'
go-version: '1.21.5'
check-latest: true

- name: golangci-lint
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
with:
version: v1.53
version: v1.55.2
4 changes: 2 additions & 2 deletions .github/workflows/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: '1.21.3'
go-version: '1.21.5'
check-latest: true

- name: Run GoReleaser
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 k8s.io/ingress-nginx

go 1.21.3
go 1.21.5

require (
dario.cat/mergo v1.0.0
Expand Down
2 changes: 1 addition & 1 deletion go.work
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
go 1.21.3
go 1.21.5

use (
.
Expand Down
4 changes: 4 additions & 0 deletions go.work.sum
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcs
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE=
github.com/moby/term v0.0.0-20221205130635-1aeaba878587/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ=
github.com/mrunalp/fileutils v0.5.1/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ=
github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU=
github.com/onsi/ginkgo/v2 v2.9.1/go.mod h1:FEcmzVcCHl+4o9bQZVab+4dC9+j+91t2FHSzmGAPfuo=
github.com/onsi/ginkgo/v2 v2.9.4/go.mod h1:gCQYp2Q+kSoIj7ykSVb9nskRSsR6PUj4AiLywzIhbKM=
Expand Down Expand Up @@ -255,6 +256,7 @@ golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE=
golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI=
Expand All @@ -267,11 +269,13 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
Expand Down
2 changes: 1 addition & 1 deletion images/custom-error-pages/rootfs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.21.3-alpine3.18 as builder
FROM golang:1.21.5-alpine3.18 as builder

RUN apk update \
&& apk upgrade && apk add git
Expand Down
2 changes: 1 addition & 1 deletion images/custom-error-pages/rootfs/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module k8s.io/ingress-nginx/custom-error-pages

go 1.21.3
go 1.21.5

require github.com/prometheus/client_golang v1.11.1

Expand Down
2 changes: 1 addition & 1 deletion images/ext-auth-example-authsvc/rootfs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21.3-alpine3.18 as builder
FROM golang:1.21.5-alpine3.18 as builder
RUN mkdir /authsvc
WORKDIR /authsvc
COPY . ./
Expand Down
2 changes: 1 addition & 1 deletion images/ext-auth-example-authsvc/rootfs/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module example.com/authsvc

go 1.21.3
go 1.21.5

require k8s.io/apimachinery v0.23.1

Expand Down
2 changes: 1 addition & 1 deletion images/fastcgi-helloserver/rootfs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.21.3-alpine3.18 as builder
FROM golang:1.21.5-alpine3.18 as builder

WORKDIR /go/src/k8s.io/ingress-nginx/images/fastcgi

Expand Down
2 changes: 1 addition & 1 deletion images/go-grpc-greeter-server/rootfs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21.3-alpine3.18 as build
FROM golang:1.21.5-alpine3.18 as build

WORKDIR /go/src/greeter-server

Expand Down
2 changes: 1 addition & 1 deletion images/httpbun/rootfs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.21.3 AS builder
FROM golang:1.21.5 AS builder

ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
Expand Down
2 changes: 1 addition & 1 deletion images/kube-webhook-certgen/rootfs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM --platform=$BUILDPLATFORM golang:1.21.3 as builder
FROM --platform=$BUILDPLATFORM golang:1.21.5 as builder
ARG BUILDPLATFORM
ARG TARGETARCH

Expand Down
2 changes: 1 addition & 1 deletion images/kube-webhook-certgen/rootfs/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/jet/kube-webhook-certgen

go 1.21.3
go 1.21.5

require (
github.com/onrik/logrus v0.9.0
Expand Down
2 changes: 1 addition & 1 deletion images/nginx/TAG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.2
0.0.3
2 changes: 1 addition & 1 deletion images/opentelemetry/rootfs/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module init-otel

go 1.21.3
go 1.21.5
4 changes: 2 additions & 2 deletions images/test-runner/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ image:
--pull \
--push \
--build-arg BASE_IMAGE=${NGINX_BASE_IMAGE} \
--build-arg GOLANG_VERSION=1.21.3 \
--build-arg GOLANG_VERSION=1.21.5 \
--build-arg ETCD_VERSION=3.4.3-0 \
--build-arg K8S_RELEASE=v1.26.0 \
--build-arg RESTY_CLI_VERSION=0.27 \
Expand All @@ -64,7 +64,7 @@ build: ensure-buildx
--progress=${PROGRESS} \
--pull \
--build-arg BASE_IMAGE=${NGINX_BASE_IMAGE} \
--build-arg GOLANG_VERSION=1.21.3 \
--build-arg GOLANG_VERSION=1.21.5 \
--build-arg ETCD_VERSION=3.4.3-0 \
--build-arg K8S_RELEASE=v1.26.0 \
--build-arg RESTY_CLI_VERSION=0.27 \
Expand Down
1 change: 1 addition & 0 deletions internal/ingress/annotations/annotations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ func TestSSLPassthrough(t *testing.T) {
ec := NewAnnotationExtractor(mockCfg{})
ing := buildIngress()

//nolint:goconst //already a constant
fooAnns := []struct {
annotations map[string]string
er bool
Expand Down
2 changes: 2 additions & 0 deletions internal/ingress/annotations/parser/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ var (

// IsValidRegex checks if the tested string can be used as a regex, but without any weird character.
// It includes regex characters for paths that may contain regexes
//
//nolint:goconst //already a constant
var IsValidRegex = regexp.MustCompile("^[/" + alphaNumericChars + regexEnabledChars + "]*$")

// SizeRegex validates sizes understood by NGINX, like 1000, 100k, 1000M
Expand Down
2 changes: 1 addition & 1 deletion magefiles/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module k8s.io/ingress-nginx/magefiles

go 1.21.3
go 1.21.5

require (
github.com/blang/semver/v4 v4.0.0
Expand Down
1 change: 1 addition & 0 deletions test/e2e/annotations/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ http {
f.EnsureIngress(ing2)

f.WaitForNginxServer(host, func(server string) bool {
//nolint:goconst //server_name is a constant
return strings.Contains(server, "server_name "+host)
})
})
Expand Down
1 change: 1 addition & 0 deletions test/e2e/annotations/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ var _ = framework.DescribeAnnotation("backend-protocol - GRPC", func() {
return strings.Contains(server, "grpc_pass grpc://upstream_balancer;")
})

//nolint:goconst //string interpolation
conn, err := grpc.Dial(f.GetNginxIP()+":443",
grpc.WithTransportCredentials(
credentials.NewTLS(&tls.Config{
Expand Down
1 change: 1 addition & 0 deletions test/e2e/framework/httpexpect/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ func (r *HTTPResponse) checkContentType(expectedType string, expectedCharset ...
}

if mediaType != expectedType {
//nolint:goconst //string interpolation
r.chain.fail("\nexpected \"Content-Type\" header with %q media type,"+
"\nbut got %q", expectedType, mediaType)
return false
Expand Down
1 change: 1 addition & 0 deletions test/e2e/settings/disable_sync_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ var _ = framework.IngressNginxDescribe("[Flag] disable-sync-events", func() {
return strings.Contains(server, fmt.Sprintf("server_name %v", host))
})

//nolint:goconst //string interpolation
events, err := f.KubeClientSet.CoreV1().Events(ing.Namespace).List(context.TODO(), metav1.ListOptions{FieldSelector: "reason=Sync,involvedObject.name=" + host})
assert.Nil(ginkgo.GinkgoT(), err, "listing events")

Expand Down
1 change: 1 addition & 0 deletions test/e2e/settings/enable_real_ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ var _ = framework.DescribeSetting("enable-real-ip", func() {

f.WaitForNginxServer(host,
func(server string) bool {
//nolint:goconst //already a const
return strings.Contains(server, "server_name "+host) &&
!strings.Contains(server, "proxy_set_header X-Forwarded-Proto $full_x_forwarded_proto;")
})
Expand Down

0 comments on commit 6807537

Please sign in to comment.