Skip to content

Commit 6973f5e

Browse files
Merge pull request #17 from umago/govulncheck
Govulncheck: Fix vulnerabilities and add CI checks
2 parents a020cce + 1246ea1 commit 6973f5e

8 files changed

Lines changed: 122 additions & 75 deletions

File tree

.github/workflows/build-and-push.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121

2222
- name: Set up Go
2323
uses: actions/setup-go@v6
24+
with:
25+
go-version-file: "go.mod"
2426

2527
- name: Prepare variables
2628
id: vars

.github/workflows/govulncheck.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: govulncheck
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
schedule:
9+
- cron: '23 6 * * *'
10+
11+
jobs:
12+
govulncheck:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v7
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v6
21+
with:
22+
go-version-file: "go.mod"
23+
24+
- name: Run govulncheck
25+
run: make govulncheck

.github/workflows/pre-commit.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616

1717
- name: Set up Go
1818
uses: actions/setup-go@v6
19+
with:
20+
go-version-file: "go.mod"
1921

2022
- name: Run pre-commit hooks
2123
uses: pre-commit/action@v3.0.1

.github/workflows/verify-generation.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616

1717
- name: Set up Go
1818
uses: actions/setup-go@v6
19+
with:
20+
go-version-file: "go.mod"
1921

2022
- name: Install operator-sdk
2123
uses: redhat-actions/openshift-tools-installer@v1

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM golang:1.24 AS builder
2+
FROM golang:1.25 AS builder
33
ARG TARGETOS
44
ARG TARGETARCH
55
ARG GOMAXPROCS

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@ lint: golangci-lint ## Run golangci-lint linter
142142
lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
143143
$(GOLANGCI_LINT) run --fix
144144

145+
##@ Security
146+
147+
.PHONY: govulncheck
148+
govulncheck: govulncheck-install ## Run govulncheck vulnerability scanner.
149+
GOTOOLCHAIN=auto $(GOVULNCHECK) ./...
150+
145151
##@ Build
146152

147153
.PHONY: build
@@ -244,13 +250,15 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
244250
ENVTEST ?= $(LOCALBIN)/setup-envtest
245251
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint
246252
KUTTL ?= $(LOCALBIN)/kubectl-kuttl
253+
GOVULNCHECK ?= $(LOCALBIN)/govulncheck
247254

248255
## Tool Versions
249256
KUSTOMIZE_VERSION ?= v5.4.2
250257
CONTROLLER_TOOLS_VERSION ?= v0.16.5
251258
ENVTEST_VERSION ?= release-0.22
252259
GOLANGCI_LINT_VERSION ?= v2.6.0
253260
KUTTL_VERSION ?= 0.22.0
261+
GOVULNCHECK_VERSION ?= v1.6.0
254262

255263
.PHONY: kustomize
256264
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
@@ -284,6 +292,10 @@ kuttl-test: kuttl ## Run kuttl tests
284292
@command -v oc >/dev/null 2>&1 || { echo "ERROR: 'oc' command is required for KUTTL tests but not found in PATH" >&2; exit 1; }
285293
$(LOCALBIN)/kubectl-kuttl test --config kuttl-test.yaml test/kuttl/tests $(KUTTL_ARGS)
286294

295+
.PHONY: govulncheck-install
296+
govulncheck-install: $(LOCALBIN) ## Download govulncheck locally if necessary.
297+
$(call go-install-tool,$(GOVULNCHECK),golang.org/x/vuln/cmd/govulncheck,$(GOVULNCHECK_VERSION))
298+
287299
.PHONY: kuttl-test-run
288300
kuttl-test-run: kuttl openstack-lightspeed-deploy kuttl-test openstack-lightspeed-undeploy
289301

go.mod

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module github.com/openstack-k8s-operators/lightspeed-operator
22

3-
go 1.24.6
3+
go 1.25.0
4+
5+
toolchain go1.25.12
46

57
require (
68
github.com/Masterminds/semver/v3 v3.4.0
@@ -26,7 +28,7 @@ require (
2628
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
2729
github.com/beorn7/perks v1.0.1 // indirect
2830
github.com/blang/semver/v4 v4.0.0 // indirect
29-
github.com/cenkalti/backoff/v5 v5.0.2 // indirect
31+
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
3032
github.com/cespare/xxhash/v2 v2.3.0 // indirect
3133
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
3234
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
@@ -47,7 +49,7 @@ require (
4749
github.com/google/go-cmp v0.7.0 // indirect
4850
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
4951
github.com/google/uuid v1.6.0 // indirect
50-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.0 // indirect
52+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.7 // indirect
5153
github.com/inconshreveable/mousetrap v1.1.0 // indirect
5254
github.com/josharian/intern v1.0.0 // indirect
5355
github.com/json-iterator/go v1.1.12 // indirect
@@ -66,34 +68,34 @@ require (
6668
github.com/spf13/pflag v1.0.9 // indirect
6769
github.com/stoewer/go-strcase v1.3.1 // indirect
6870
github.com/x448/float16 v0.8.4 // indirect
69-
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
70-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
71-
go.opentelemetry.io/otel v1.36.0 // indirect
72-
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0 // indirect
73-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0 // indirect
74-
go.opentelemetry.io/otel/metric v1.36.0 // indirect
75-
go.opentelemetry.io/otel/sdk v1.36.0 // indirect
76-
go.opentelemetry.io/otel/trace v1.36.0 // indirect
77-
go.opentelemetry.io/proto/otlp v1.7.0 // indirect
71+
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
72+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 // indirect
73+
go.opentelemetry.io/otel v1.44.0 // indirect
74+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.40.0 // indirect
75+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.40.0 // indirect
76+
go.opentelemetry.io/otel/metric v1.44.0 // indirect
77+
go.opentelemetry.io/otel/sdk v1.44.0 // indirect
78+
go.opentelemetry.io/otel/trace v1.44.0 // indirect
79+
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
7880
go.uber.org/multierr v1.11.0 // indirect
7981
go.uber.org/zap v1.27.0 // indirect
8082
go.yaml.in/yaml/v2 v2.4.2 // indirect
8183
go.yaml.in/yaml/v3 v3.0.4 // indirect
8284
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect
83-
golang.org/x/mod v0.27.0 // indirect
84-
golang.org/x/net v0.43.0 // indirect
85-
golang.org/x/oauth2 v0.30.0 // indirect
86-
golang.org/x/sync v0.16.0 // indirect
87-
golang.org/x/sys v0.35.0 // indirect
88-
golang.org/x/term v0.34.0 // indirect
89-
golang.org/x/text v0.28.0 // indirect
85+
golang.org/x/mod v0.35.0 // indirect
86+
golang.org/x/net v0.55.0 // indirect
87+
golang.org/x/oauth2 v0.34.0 // indirect
88+
golang.org/x/sync v0.20.0 // indirect
89+
golang.org/x/sys v0.45.0 // indirect
90+
golang.org/x/term v0.43.0 // indirect
91+
golang.org/x/text v0.37.0 // indirect
9092
golang.org/x/time v0.12.0 // indirect
91-
golang.org/x/tools v0.36.0 // indirect
93+
golang.org/x/tools v0.44.0 // indirect
9294
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
93-
google.golang.org/genproto/googleapis/api v0.0.0-20250603155806-513f23925822 // indirect
94-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 // indirect
95-
google.golang.org/grpc v1.73.0 // indirect
96-
google.golang.org/protobuf v1.36.7 // indirect
95+
google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409 // indirect
96+
google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 // indirect
97+
google.golang.org/grpc v1.78.0 // indirect
98+
google.golang.org/protobuf v1.36.11 // indirect
9799
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
98100
gopkg.in/inf.v0 v0.9.1 // indirect
99101
gopkg.in/yaml.v3 v3.0.1 // indirect

0 commit comments

Comments
 (0)