Skip to content

Commit

Permalink
fix(Makefile): correct user-agent version
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <[email protected]>
  • Loading branch information
therealbobo authored and poiana committed Apr 20, 2023
1 parent cbaac97 commit c70bca0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,18 @@ GIT_COMMIT := $(if $(shell git status --porcelain --untracked-files=no),${COMMIT
GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
GIT_BRANCH_CLEAN := $(shell echo $(GIT_BRANCH) | sed -e "s/[^[:alnum:]]/-/g")

VERSION = $(shell git describe --tags)

CLIENTGO_VERSION := $(shell grep 'k8s.io/client-go' go.mod | cut -dv -f2)

IMAGE_NAME ?= docker.io/falcosecurity/event-generator

IMAGE_NAME_BRANCH := $(IMAGE_NAME):$(GIT_BRANCH_CLEAN)
IMAGE_NAME_COMMIT := $(IMAGE_NAME):$(GIT_COMMIT)

LDFLAGS = -X k8s.io/client-go/pkg/version.gitCommit=v$(CLIENTGO_VERSION) \
-X k8s.io/client-go/pkg/version.gitVersion=$(VERSION)

TEST_FLAGS ?= -v -race

main ?= .
Expand All @@ -27,7 +34,7 @@ prepare: clean events/k8saudit/yaml/bundle.go

.PHONY: ${output}
${output}:
$(GO) build -buildmode=pie -buildvcs=false -o $@ ${main}
$(GO) build -buildmode=pie -buildvcs=false -ldflags "$(LDFLAGS)" -o $@ ${main}

.PHONY: clean
clean:
Expand Down

0 comments on commit c70bca0

Please sign in to comment.