Skip to content

Commit 0af69b8

Browse files
nginx-botjavorszkyvepatel
authored
Tweak some maintenance make targets (#8772)
Tweak some maintenance make targets (#8618) * Tweak some maintenance make targets * Update snaps always so CI passes Ref: https://github.com/gkampitakis/go-snaps?tab=readme-ov-file#running-tests-on-ci Otherwise go-snaps detects that it's running in CI and will always fail, unless we set the env var to always instead of "true". * Clean docker builder cache before building images * Add comment to govulncheck make target * staticcheck and govulncheck renovate config * Update renovate configs --------- Co-authored-by: Gabor Javorszky <g.javorszky@f5.com> Co-authored-by: Venktesh Shivam Patel <ve.patel@f5.com>
1 parent 09232d0 commit 0af69b8

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

Makefile

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ NAP_AGENT_VERSION ?= 2
1212
NGINX_AGENT_VERSION ?= 3.6
1313
PLUS_ARGS = --build-arg NGINX_PLUS_VERSION=$(NGINX_PLUS_VERSION) --secret id=nginx-repo.crt,src=nginx-repo.crt --secret id=nginx-repo.key,src=nginx-repo.key
1414

15+
# renovate: datasource=github-releases depName=dominikh/go-tools
16+
STATICCHECK_VERSION ?= 2025.1.1
17+
18+
# renovate: datasource=github-releases depName=golang/vuln
19+
GOVULNCHECK_VERSION ?= v1.1.4
20+
1521
# Variables that can be overridden
1622
REGISTRY ?= ## The registry where the image is located.
1723
PREFIX ?= nginx/nginx-ingress ## The name of the image. For example, nginx/nginx-ingress
@@ -79,16 +85,21 @@ format: ## Run goimports & gofmt
7985

8086
.PHONY: staticcheck
8187
staticcheck: ## Run staticcheck linter
82-
@staticcheck -version >/dev/null 2>&1 || go install honnef.co/go/tools/cmd/staticcheck@2022.1.3;
88+
@staticcheck -version >/dev/null 2>&1 || go install honnef.co/go/tools/cmd/staticcheck@${STATICCHECK_VERSION};
8389
staticcheck ./...
8490

91+
.PHONY: govulncheck
92+
govulncheck: ## Run govulncheck linter
93+
@govulncheck -version >/dev/null 2>&1 || go install golang.org/x/vuln/cmd/govulncheck@${GOVULNCHECK_VERSION};
94+
govulncheck ./...
95+
8596
.PHONY: test
8697
test: ## Run GoLang tests
8798
go test -tags=aws,helmunit -shuffle=on ./...
8899

89100
.PHONY: test-update-snaps
90101
test-update-snaps:
91-
UPDATE_SNAPS=true go test -tags=aws,helmunit -shuffle=on ./...
102+
UPDATE_SNAPS=always go test -tags=aws,helmunit -shuffle=on ./...
92103

93104
cover: ## Generate coverage report
94105
go test -tags=aws,helmunit -shuffle=on -race -coverprofile=coverage.txt -covermode=atomic ./...
@@ -235,7 +246,12 @@ ubi-image-nap-dos-plus: build ## Create Docker image for Ingress Controller (UBI
235246
--build-arg NAP_MODULES=waf,dos --build-arg NAP_WAF_VERSION=$(NAP_WAF_VERSION) --build-arg NAP_AGENT_VERSION=$(NAP_AGENT_VERSION)
236247

237248
.PHONY: all-images ## Create all the Docker images for Ingress Controller
238-
all-images: alpine-image alpine-image-plus alpine-image-plus-fips alpine-image-nap-plus-fips debian-image debian-image-plus debian-image-nap-plus debian-image-dos-plus debian-image-nap-dos-plus ubi-image ubi-image-plus ubi-image-nap-plus ubi-image-dos-plus ubi-image-nap-dos-plus
249+
all-images:
250+
docker builder prune -af; \
251+
images="alpine-image alpine-image-plus alpine-image-plus-fips alpine-image-nap-plus-fips debian-image debian-image-plus debian-image-nap-plus debian-image-dos-plus debian-image-nap-dos-plus ubi-image ubi-image-plus ubi-image-nap-plus ubi-image-dos-plus ubi-image-nap-dos-plus"; \
252+
for img in $$images; do \
253+
TAG="$(strip $(TAG))-$$img" make $$img; \
254+
done
239255

240256
.PHONY: patch-os
241257
patch-os: ## Patch supplied image

0 commit comments

Comments
 (0)