diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 35bc574582e..e464b2e2b02 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -427,20 +427,19 @@ }, { "customType": "regex", + // explicitely not writing ^Makefile$ to match files with Makefile.extension "fileMatch": [ - "^Makefile\\.cli$" - ], - "matchStrings": [ - "# renovate: datasource=(?.*?)\\s+GO_IMAGE[[:blank:]]*=[[:blank:]]*(?.*?):(?[^\\s@]*)@?(?sha256:[a-f0-9]+)?", - ] - }, - { - "customType": "regex", - "fileMatch": [ - "^Makefile$" - ], + "^Makefile" + ], + // This regex is for upgrading docker image full reference in Makefiles, for examples: + // + // # renovate: datasource=docker + // GOLANGCILINT_IMAGE=docker.io/golangci/golangci-lint:v1.55.2@sha256:e699df940be1810b08ba6ec050bfc34cc1931027283b5a7f607fb6a67b503876 + // + // # renovate: datasource=docker + // GO_IMAGE = docker.io/library/golang:1.21.6-alpine@sha256:a6a7f1fcf12f5efa9e04b1e75020931a616cd707f14f62ab5262bfbe109aa84 "matchStrings": [ - "# renovate: datasource=(?.*?) depName=(?.*?)\\s+GOLANGCILINT_WANT_VERSION[[:blank:]]*=[[:blank:]]*(?[^\\s]*)" + "# renovate: datasource=(?.*?)\\s+.+[[:blank:]]*=[[:blank:]]*(?.*?):(?[^\\s@]*)@?(?sha256:[a-f0-9]+)?" ] }, { diff --git a/Dockerfile.golangci-lint b/Dockerfile.golangci-lint deleted file mode 100644 index 72992a57203..00000000000 --- a/Dockerfile.golangci-lint +++ /dev/null @@ -1,5 +0,0 @@ -FROM docker.io/golangci/golangci-lint:v1.55.2@sha256:e699df940be1810b08ba6ec050bfc34cc1931027283b5a7f607fb6a67b503876 -RUN apt-get -y update -RUN apt-get -y install libz-dev libelf-dev - -#- vi: ft=dockerfile -# diff --git a/Makefile b/Makefile index 454c45ce3a2..d351b2188e4 100644 --- a/Makefile +++ b/Makefile @@ -17,10 +17,6 @@ E2E_TEST_TIMEOUT ?= 20m BUILD_PKG_DIR ?= $(shell pwd)/build/$(TARGET_ARCH) VERSION ?= $(shell git describe --tags --always) -# renovate: datasource=docker depName=docker.io/golangci/golangci-lint -GOLANGCILINT_WANT_VERSION = v1.55.2 -GOLANGCILINT_VERSION = $(shell golangci-lint version 2>/dev/null) - # Do a parallel build with multiple jobs, based on the number of CPUs online # in this system: 'make -j8' on a 8-CPU system, etc. # @@ -352,21 +348,23 @@ codegen: image-codegen protoc-gen-go-tetragon: $(GO_BUILD) -o bin/$@ ./cmd/protoc-gen-go-tetragon/ +# renovate: datasource=docker +GOLANGCILINT_IMAGE=docker.io/golangci/golangci-lint:v1.55.2@sha256:e699df940be1810b08ba6ec050bfc34cc1931027283b5a7f607fb6a67b503876 +GOLANGCILINT_WANT_VERSION := $(subst @sha256,,$(patsubst v%,%,$(word 2,$(subst :, ,$(lastword $(subst /, ,$(GOLANGCILINT_IMAGE))))))) +GOLANGCILINT_VERSION = $(shell golangci-lint version 2>/dev/null) .PHONY: check ifneq (,$(findstring $(GOLANGCILINT_WANT_VERSION),$(GOLANGCILINT_VERSION))) check: golangci-lint run else check: - $(CONTAINER_ENGINE) build -t golangci-lint:tetragon . -f Dockerfile.golangci-lint - $(CONTAINER_ENGINE) run --rm -v `pwd`:/app:Z -w /app golangci-lint:tetragon golangci-lint run + $(CONTAINER_ENGINE) run --rm -v `pwd`:/app:Z -w /app --env GOTOOLCHAIN=auto $(GOLANGCILINT_IMAGE) golangci-lint run endif .PHONY: copy-golangci-lint copy-golangci-lint: mkdir -p bin/ - $(CONTAINER_ENGINE) build -t golangci-lint:tetragon . -f Dockerfile.golangci-lint - $(eval xid=$(shell docker create golangci-lint:tetragon)) + $(eval xid=$(shell $(CONTAINER_ENGINE) create $(GOLANGCILINT_IMAGE))) echo ${xid} docker cp ${xid}:/usr/bin/golangci-lint bin/golangci-lint docker rm ${xid}