From 2c6655ca5667004b3b52878846c6956cd63aff9f Mon Sep 17 00:00:00 2001 From: Christian Groschupp Date: Mon, 3 Jul 2023 09:02:26 +0200 Subject: [PATCH] use only tags with prefix v for version determination --- Makefile | 2 +- scripts/releaser.sh | 2 +- scripts/run-trivy.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 500fea06a6..f077f317d3 100644 --- a/Makefile +++ b/Makefile @@ -87,7 +87,7 @@ BINARY ?= external-dns SOURCES = $(shell find . -name '*.go') IMAGE_STAGING = gcr.io/k8s-staging-external-dns/$(BINARY) IMAGE ?= us.gcr.io/k8s-artifacts-prod/external-dns/$(BINARY) -VERSION ?= $(shell git describe --tags --always --dirty) +VERSION ?= $(shell git describe --tags --always --dirty --match "v*") BUILD_FLAGS ?= -v LDFLAGS ?= -X sigs.k8s.io/external-dns/pkg/apis/externaldns.Version=$(VERSION) -w -s ARCHS = amd64 arm64 arm/v7 diff --git a/scripts/releaser.sh b/scripts/releaser.sh index 5af06a5989..c44ff83bf4 100755 --- a/scripts/releaser.sh +++ b/scripts/releaser.sh @@ -9,7 +9,7 @@ function generate_changelog { # current tag is a full release previous_tag="" while [[ -z $previous_tag || ( $previous_tag == *-* && $current_tag != *-* ) ]]; do - previous_tag="$(git describe --tags "$start_ref"^ --abbrev=0)" + previous_tag="$(git describe --tags "$start_ref"^ --abbrev=0 --match "v*")" start_ref="$previous_tag" done diff --git a/scripts/run-trivy.sh b/scripts/run-trivy.sh index b84dad1705..07b7aa2b86 100755 --- a/scripts/run-trivy.sh +++ b/scripts/run-trivy.sh @@ -10,4 +10,4 @@ chmod +x trivy # run trivy cd - -/tmp/trivy image --exit-code 1 us.gcr.io/k8s-artifacts-prod/external-dns/external-dns:$(git describe --tags --always --dirty) +/tmp/trivy image --exit-code 1 us.gcr.io/k8s-artifacts-prod/external-dns/external-dns:$(git describe --tags --always --dirty --match "v*")