Skip to content

Commit d43cd88

Browse files
committed
Add govulncheck to makefile.
1 parent 22f7974 commit d43cd88

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Makefile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ $(KUBEBUILDER_ASSETS):
2424
kubebuilder-assets: $(KUBEBUILDER_ASSETS)
2525

2626
.PHONY: unit-tests
27-
unit-tests: install-tools $(KUBEBUILDER_ASSETS) generate fmt vet manifests ## Run unit tests
27+
unit-tests: install-tools $(KUBEBUILDER_ASSETS) generate fmt vet vuln manifests ## Run unit tests
2828
ginkgo -r --randomize-all api/ internal/ pkg/
2929

3030
.PHONY: integration-tests
31-
integration-tests: install-tools $(KUBEBUILDER_ASSETS) generate fmt vet manifests ## Run integration tests
31+
integration-tests: install-tools $(KUBEBUILDER_ASSETS) generate fmt vet vuln manifests ## Run integration tests
3232
ginkgo -r controllers/
3333

3434
manifests: install-tools ## Generate manifests e.g. CRD, RBAC etc.
@@ -53,13 +53,17 @@ fmt:
5353
vet:
5454
go vet ./...
5555

56+
# Run govulncheck against code
57+
vuln:
58+
govulncheck ./...
59+
5660
# Generate code & docs
5761
generate: install-tools api-reference
5862
controller-gen object:headerFile=./hack/NOTICE.go.txt paths=./api/...
5963
controller-gen object:headerFile=./hack/NOTICE.go.txt paths=./internal/status/...
6064

6165
# Build manager binary
62-
manager: generate fmt vet
66+
manager: generate fmt vet vuln
6367
go mod download
6468
go build -o bin/manager main.go
6569

@@ -80,7 +84,7 @@ destroy: ## Cleanup all controller artefacts
8084
kustomize build config/rbac/ | kubectl delete --ignore-not-found=true -f -
8185
kustomize build config/namespace/base/ | kubectl delete --ignore-not-found=true -f -
8286

83-
run: generate manifests fmt vet install deploy-namespace-rbac just-run ## Run operator binary locally against the configured Kubernetes cluster in ~/.kube/config
87+
run: generate manifests fmt vet vuln install deploy-namespace-rbac just-run ## Run operator binary locally against the configured Kubernetes cluster in ~/.kube/config
8488

8589
just-run: ## Just runs 'go run main.go' without regenerating any manifests or deploying RBACs
8690
KUBECONFIG=${HOME}/.kube/config OPERATOR_NAMESPACE=$(K8S_OPERATOR_NAMESPACE) go run ./main.go -metrics-bind-address 127.0.0.1:9782 --zap-devel $(OPERATOR_ARGS)
@@ -182,6 +186,7 @@ docker-registry-secret: check-env-docker-credentials
182186
install-tools:
183187
go mod download
184188
grep _ tools/tools.go | awk -F '"' '{print $$2}' | xargs -t go install
189+
go install "golang.org/x/vuln/cmd/govulncheck@latest"
185190

186191
check-env-docker-repo: check-env-registry-server
187192
ifndef OPERATOR_IMAGE

0 commit comments

Comments
 (0)