diff --git a/.github/workflows/docker-main.yaml b/.github/workflows/docker-main.yaml index 3dd2fa0f..428c95c9 100644 --- a/.github/workflows/docker-main.yaml +++ b/.github/workflows/docker-main.yaml @@ -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 diff --git a/.github/workflows/docker-version-branches.yaml b/.github/workflows/docker-version-branches.yaml index 6a2ca4f7..fae39eb9 100644 --- a/.github/workflows/docker-version-branches.yaml +++ b/.github/workflows/docker-version-branches.yaml @@ -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 diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index cecb5987..ae755ae3 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 666c4796..c1decf5f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 646d2ef1..a71ee595 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 06a9a590..94e80cce 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -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" @@ -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 @@ -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: diff --git a/.github/workflows/update-core.yaml b/.github/workflows/update-core.yaml index 1d9776bc..fc8d5180 100644 --- a/.github/workflows/update-core.yaml +++ b/.github/workflows/update-core.yaml @@ -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 diff --git a/.golangci.yml b/.golangci.yml index 2521335e..5e4df4f8 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -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 diff --git a/.tool-versions b/.tool-versions index f5264425..1a59aeb0 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -golang 1.22.0 +golang 1.23.0 diff --git a/controllers/ingress/controller_test.go b/controllers/ingress/controller_test.go index 7dc7999c..01e8b831 100644 --- a/controllers/ingress/controller_test.go +++ b/controllers/ingress/controller_test.go @@ -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 { diff --git a/controllers/ingress/once_test.go b/controllers/ingress/once_test.go index a2b75f7f..a674e3c7 100644 --- a/controllers/ingress/once_test.go +++ b/controllers/ingress/once_test.go @@ -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") @@ -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) diff --git a/docs/parse.go b/docs/parse.go index 2f0de65c..c1110fc1 100644 --- a/docs/parse.go +++ b/docs/parse.go @@ -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 } diff --git a/go.mod b/go.mod index c1691835..e4791f95 100644 --- a/go.mod +++ b/go.mod @@ -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 @@ -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 @@ -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 diff --git a/go.sum b/go.sum index 50203a20..44e4df44 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/internal/filemgr/filemgr_test.go b/internal/filemgr/filemgr_test.go index e41810b0..e516c747 100644 --- a/internal/filemgr/filemgr_test.go +++ b/internal/filemgr/filemgr_test.go @@ -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++ } diff --git a/internal/stress/cmd/command.go b/internal/stress/cmd/command.go index b78970da..5f886ad8 100644 --- a/internal/stress/cmd/command.go +++ b/internal/stress/cmd/command.go @@ -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())) }, diff --git a/internal/stress/echo.go b/internal/stress/echo.go index d4ed9395..2ba30337 100644 --- a/internal/stress/echo.go +++ b/internal/stress/echo.go @@ -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")) }), diff --git a/pomerium/routes_test.go b/pomerium/routes_test.go index 7f349b32..129aebd6 100644 --- a/pomerium/routes_test.go +++ b/pomerium/routes_test.go @@ -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",