Skip to content

Commit

Permalink
runtime: upgrade Go to 1.23.0, bump core (#1024)
Browse files Browse the repository at this point in the history
  • Loading branch information
wasaga authored Aug 15, 2024
1 parent ce2ac71 commit 97e23d6
Show file tree
Hide file tree
Showing 18 changed files with 28 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
go-version: 1.22.x
go-version: 1.23.x

- name: Docker meta
id: meta
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-version-branches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
go-version: 1.22.x
go-version: 1.23.x

- name: Docker meta
id: meta
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
go-version: 1.22.x
go-version: 1.23.x

- name: generate docs
run: make docs
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:
- run: make envoy
- run: make pomerium-ui

- uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86
- name: Run golangci-lint
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86
with:
version: v1.55
version: v1.60.1
args: --timeout=10m
skip-cache: true
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
go-version: 1.22.x
go-version: 1.23.x

- name: Build
run: make build-ci
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
go-version: 1.22.x
go-version: 1.23.x
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f
with:
python-version: "3.x"
Expand All @@ -36,7 +36,7 @@ jobs:
steps:
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
go-version: 1.22.x
go-version: 1.23.x
- name: set env vars
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
steps:
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
go-version: 1.22.x
go-version: 1.23.x
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
go-version: 1.22.x
go-version: 1.23.x
- name: Update Core
run: |
go get -u github.com/pomerium/pomerium@main
Expand Down
25 changes: 1 addition & 24 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,35 +63,12 @@ linters:
- nakedret
- nolintlint
- revive
- rowserrcheck
- staticcheck
- stylecheck
- typecheck
- unconvert
- unused
# - asciicheck
# - dupl
# - exhaustive
# - funlen
# - gochecknoglobals
# - gochecknoinits
# - gocognit
# - goconst
# - gocritic
# - gocyclo
# - godot
# - godox
# - goerr113
# - gomnd
# - interfacer
# - maligned
# - nestif
# - noctx
# - prealloc
# - scopelint
# - testpackage
# - whitespace
# - wsl
- whitespace

issues:
exclude-use-default: false
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
golang 1.22.0
golang 1.23.0
2 changes: 1 addition & 1 deletion controllers/ingress/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestManagingIngressClass(t *testing.T) {
ingressClassKind: "IngressClass",
secretKind: "Secret",
serviceKind: "Service",
initComplete: newOnce(func(ctx context.Context) error { return nil }),
initComplete: newOnce(func(_ context.Context) error { return nil }),
}

testCases := []struct {
Expand Down
4 changes: 2 additions & 2 deletions controllers/ingress/once_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestOnce(t *testing.T) {
var callCount int32
var errSeen int32

o := newOnce(func(ctx context.Context) error {
o := newOnce(func(_ context.Context) error {
_ = atomic.AddInt32(&callCount, 1)
time.Sleep(time.Second)
return fmt.Errorf("ERROR")
Expand All @@ -28,7 +28,7 @@ func TestOnce(t *testing.T) {
iters := 100
wg.Add(iters)
for i := 0; i < iters; i++ {
go func(x int) {
go func(_ int) {
time.Sleep(time.Millisecond * time.Duration(rand.Intn(10)+10))
if err := o.yield(ctx); err != nil {
_ = atomic.AddInt32(&errSeen, 1)
Expand Down
4 changes: 2 additions & 2 deletions docs/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ func flatten(key string, src extv1.JSONSchemaProps, objects map[string]*Object)
Properties: make(map[string]*Property),
}

atomicHandler := func(key string, prop extv1.JSONSchemaProps) (*Property, error) {
atomicHandler := func(_ string, prop extv1.JSONSchemaProps) (*Property, error) {
return &Property{ObjectOrAtomic: ObjectOrAtomic{Atomic: atomic(prop)}}, nil
}

arrayHandler := func(key string, prop extv1.JSONSchemaProps) (*Property, error) {
arrayHandler := func(_ string, prop extv1.JSONSchemaProps) (*Property, error) {
return &Property{ObjectOrAtomic: ObjectOrAtomic{Atomic: array(prop)}}, nil
}

Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/pomerium/ingress-controller

go 1.22.2
go 1.23.0

require (
github.com/cenkalti/backoff/v4 v4.3.0
Expand All @@ -16,7 +16,8 @@ require (
github.com/iancoleman/strcase v0.3.0
github.com/martinlindhe/base36 v1.1.1
github.com/open-policy-agent/opa v0.67.1
github.com/pomerium/pomerium v0.26.1-0.20240809180510-554e77bc7c82
github.com/pomerium/csrf v1.7.0
github.com/pomerium/pomerium v0.26.1-0.20240815191621-c8d0c87c178f
github.com/rs/zerolog v1.33.0
github.com/sergi/go-diff v1.3.1
github.com/spf13/cobra v1.8.1
Expand Down Expand Up @@ -158,7 +159,6 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/pomerium/csrf v1.7.0 // indirect
github.com/pomerium/datasource v0.18.2-0.20221108160055-c6134b5ed524 // indirect
github.com/pomerium/webauthn v0.0.0-20240603205124-0428df511172 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,8 @@ github.com/pomerium/csrf v1.7.0 h1:Qp4t6oyEod3svQtKfJZs589mdUTWKVf7q0PgCKYCshY=
github.com/pomerium/csrf v1.7.0/go.mod h1:hAPZV47mEj2T9xFs+ysbum4l7SF1IdrryYaY6PdoIqw=
github.com/pomerium/datasource v0.18.2-0.20221108160055-c6134b5ed524 h1:3YQY1sb54tEEbr0L73rjHkpLB0IB6qh3zl1+XQbMLis=
github.com/pomerium/datasource v0.18.2-0.20221108160055-c6134b5ed524/go.mod h1:7fGbUYJnU8RcxZJvUvhukOIBv1G7LWDAHMfDxAf5+Y0=
github.com/pomerium/pomerium v0.26.1-0.20240809180510-554e77bc7c82 h1:ZUWd5wLwvjHaEAb6BKyJFHDtYP7ntZhSF0l1MuzZjAQ=
github.com/pomerium/pomerium v0.26.1-0.20240809180510-554e77bc7c82/go.mod h1:FK1AIT4gudMJN0kugYYTSNA7g2CeizZb3se0DJ/Vrq8=
github.com/pomerium/pomerium v0.26.1-0.20240815191621-c8d0c87c178f h1:WZWX8J3ZjW+3yc9kfQQM6EKr9I+dirXDgVtHBnlC8WQ=
github.com/pomerium/pomerium v0.26.1-0.20240815191621-c8d0c87c178f/go.mod h1:LL0GDU4FB3fCQTVZTqSX2ikxogK5PDmLwyjDnTgEI/o=
github.com/pomerium/webauthn v0.0.0-20240603205124-0428df511172 h1:TqoPqRgXSHpn+tEJq6H72iCS5pv66j3rPprThUEZg0E=
github.com/pomerium/webauthn v0.0.0-20240603205124-0428df511172/go.mod h1:kBQ45E9LluzW7FP1Scn3esaiS2WVbvNRLMOTHareZNQ=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=
Expand Down
2 changes: 1 addition & 1 deletion internal/filemgr/filemgr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestManager(t *testing.T) {

func countFiles(dir string) int {
fileCount := 0
filepath.Walk(dir, func(path string, info fs.FileInfo, err error) error {
filepath.Walk(dir, func(_ string, info fs.FileInfo, _ error) error {
if !info.IsDir() {
fileCount++
}
Expand Down
2 changes: 1 addition & 1 deletion internal/stress/cmd/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func Command() (*cobra.Command, error) {
return &cobra.Command{
Use: "stress-test",
Short: "stress test the ingress controller",
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, _ []string) error {
setupLogger()
return run(withInterruptSignal(context.Background()))
},
Expand Down
2 changes: 1 addition & 1 deletion internal/stress/echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func RunHTTPEchoServer(ctx context.Context, addr string) error {
s := &http.Server{
Addr: addr,
ReadHeaderTimeout: 10 * time.Second,
Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
Handler: http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)
_, _ = w.Write([]byte("OK\n"))
}),
Expand Down
2 changes: 1 addition & 1 deletion pomerium/routes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ func TestTCPUpstream(t *testing.T) {
}

func TestExternalService(t *testing.T) {
makeRoute := func(t *testing.T, secure bool) (*pb.Route, error) {
makeRoute := func(_ *testing.T, secure bool) (*pb.Route, error) {
typePrefix := networkingv1.PathTypePrefix
ic := &model.IngressConfig{
AnnotationPrefix: "p",
Expand Down

0 comments on commit 97e23d6

Please sign in to comment.