diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index aafbdcb78..13f015ac1 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -12,7 +12,7 @@ permissions: jobs: linter: runs-on: ubuntu-latest - steps: + steps: - name: Harden Runner uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 with: @@ -28,11 +28,12 @@ jobs: storage.googleapis.com:443 uploads.github.com:443 sum.golang.org:443 - + raw.githubusercontent.com:443 + - name: Setup Golang uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe with: - go-version: "1.22" + go-version: "1.23" - name: Checkout Git Repo uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab @@ -40,5 +41,5 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc with: - version: v1.56.2 - args: ./... \ No newline at end of file + version: v1.60 + args: ./... diff --git a/.github/workflows/system-test.yml b/.github/workflows/system-test.yml index 5c9e26e76..e292e64d2 100644 --- a/.github/workflows/system-test.yml +++ b/.github/workflows/system-test.yml @@ -67,7 +67,7 @@ jobs: - name: Setup Golang uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe with: - go-version: "1.22" + go-version: "1.23" - name: Run integration Tests run: make system-test diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 76fb6a515..d350e5b9c 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -25,14 +25,14 @@ jobs: go.dev:443 storage.googleapis.com:443 *.docker.io:443 - + - name: Setup Golang uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe with: - go-version: "1.22" - + go-version: "1.23" + - name: Checkout Git Repo uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab - + - name: Run Unit Tests - run: make test \ No newline at end of file + run: make test diff --git a/Dockerfile b/Dockerfile index d93a798e1..5bda9f976 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 -ARG GO_VERSION=1.22.0 +ARG GO_VERSION=1.23.0 ARG XX_VERSION=1.2.1 ARG GOLANGCI_LINT_VERSION=v1.55.2 diff --git a/Makefile b/Makefile index 2c7f71dff..10d3e0c99 100644 --- a/Makefile +++ b/Makefile @@ -82,7 +82,7 @@ kubehound: | build ## Prepare kubehound (build go binary, deploy backend) ./bin/build/kubehound .PHONY: test -test: ## Run the full suite of unit tests +test: ## Run the full suite of unit tests cd pkg && go test -count=1 -race $(BUILD_FLAGS) ./... .PHONY: system-test diff --git a/docs/dev-guide/getting-started.md b/docs/dev-guide/getting-started.md index 1ae71130c..6f0dc4ba0 100644 --- a/docs/dev-guide/getting-started.md +++ b/docs/dev-guide/getting-started.md @@ -8,7 +8,7 @@ make help ## Requirements build -- go (v1.22): https://go.dev/doc/install +- go (v1.23): https://go.dev/doc/install - [Docker](https://docs.docker.com/engine/install/) >= 19.03 (`docker version`) - [Docker Compose](https://docs.docker.com/compose/compose-file/compose-versioning/) >= v2.0 (`docker compose version`) diff --git a/docs/dev-guide/testing.md b/docs/dev-guide/testing.md index 656335835..cf509cb59 100644 --- a/docs/dev-guide/testing.md +++ b/docs/dev-guide/testing.md @@ -7,7 +7,7 @@ To ensure no regression in KubeHound, 2 kinds of tests are in place: ## Requirements test -- [Golang](https://go.dev/doc/install) `>= 1.22` +- [Golang](https://go.dev/doc/install) `>= 1.23` - [Kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installing-with-a-package-manager) - [Kubectl](https://kubernetes.io/docs/tasks/tools/) diff --git a/go.mod b/go.mod index 8bc32fea6..e0136cd30 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/DataDog/KubeHound -go 1.22.0 +go 1.23.0 -toolchain go1.22.1 +toolchain go1.23 require ( github.com/DataDog/datadog-go/v5 v5.5.0 @@ -276,7 +276,7 @@ require ( require ( github.com/oklog/ulid/v2 v2.1.0 - github.com/sirupsen/logrus v1.9.3 + github.com/sirupsen/logrus v1.9.3 // indirect github.com/spf13/viper v1.19.0 golang.org/x/net v0.26.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/pkg/config/run_id.go b/pkg/config/run_id.go index 62023899c..95210c283 100644 --- a/pkg/config/run_id.go +++ b/pkg/config/run_id.go @@ -28,7 +28,7 @@ func (r RunID) String() string { // Timestamp returns the timestamp embedded within the run id. func (r RunID) Timestamp() time.Time { - return time.UnixMilli(int64(r.val.Time())) + return time.UnixMilli(int64(r.val.Time())) //nolint:gosec } func LoadRunID(runid string) (*RunID, error) { diff --git a/pkg/ingestor/api/api.go b/pkg/ingestor/api/api.go index 7aeef285a..17842fa18 100644 --- a/pkg/ingestor/api/api.go +++ b/pkg/ingestor/api/api.go @@ -103,7 +103,7 @@ func (g *IngestorAPI) RehydrateLatest(ctx context.Context) ([]*grpc.IngestedClus return res, errRet } -func (g *IngestorAPI) Ingest(ctx context.Context, path string) error { +func (g *IngestorAPI) Ingest(ctx context.Context, path string) error { //nolint: contextcheck l := log.Logger(ctx) archivePath, err := g.puller.Pull(ctx, path) diff --git a/pkg/kubehound/storage/graphdb/janusgraph_edge_writer.go b/pkg/kubehound/storage/graphdb/janusgraph_edge_writer.go index 4818a5e43..e8c2619ae 100644 --- a/pkg/kubehound/storage/graphdb/janusgraph_edge_writer.go +++ b/pkg/kubehound/storage/graphdb/janusgraph_edge_writer.go @@ -105,7 +105,7 @@ func (jgv *JanusGraphEdgeWriter) batchWrite(ctx context.Context, data []any) err datalen := len(data) _ = statsd.Count(ctx, metric.EdgeWrite, int64(datalen), jgv.tags, 1) log.Trace(ctx).Debugf("Batch write JanusGraphEdgeWriter with %d elements", datalen) - atomic.AddInt32(&jgv.wcounter, int32(datalen)) + atomic.AddInt32(&jgv.wcounter, int32(datalen)) //nolint:gosec // disable G115 op := jgv.gremlin(jgv.traversalSource, data) promise := op.Iterate() diff --git a/pkg/kubehound/storage/graphdb/janusgraph_vertex_writer.go b/pkg/kubehound/storage/graphdb/janusgraph_vertex_writer.go index ec7c8c9ad..43396746c 100644 --- a/pkg/kubehound/storage/graphdb/janusgraph_vertex_writer.go +++ b/pkg/kubehound/storage/graphdb/janusgraph_vertex_writer.go @@ -132,7 +132,7 @@ func (jgv *JanusGraphVertexWriter) batchWrite(ctx context.Context, data []any) e datalen := len(data) _ = statsd.Count(ctx, metric.VertexWrite, int64(datalen), jgv.tags, 1) log.Trace(ctx).Debugf("Batch write JanusGraphVertexWriter with %d elements", datalen) - atomic.AddInt32(&jgv.wcounter, int32(datalen)) + atomic.AddInt32(&jgv.wcounter, int32(datalen)) //nolint:gosec // disable G115 op := jgv.gremlin(jgv.traversalSource, data) raw, err := op.Project("id", "storeID"). diff --git a/pkg/telemetry/log/kv.go b/pkg/telemetry/log/kv.go index 2136eb036..523cba161 100644 --- a/pkg/telemetry/log/kv.go +++ b/pkg/telemetry/log/kv.go @@ -197,8 +197,8 @@ func (enc *kvEncoder) AppendDuration(value time.Duration) { func (enc *kvEncoder) AppendComplex128(value complex128) { enc.addElementSeparator() - r, i := float64(real(value)), float64(imag(value)) //nolint: unconvert - enc.buf.AppendFloat(r, 64) //nolint: gomnd + r, i := float64(real(value)), float64(imag(value)) + enc.buf.AppendFloat(r, 64) //nolint: gomnd enc.buf.AppendByte('+') enc.buf.AppendFloat(i, 64) //nolint: gomnd enc.buf.AppendByte('i')