Define deprecation version in lint rules by LDFLAG

Signed-off-by: Joe Julian <me@joejulian.name>
pull/8608/head
Joe Julian 5 years ago
parent e08b81465f
commit 4541ab9bed
No known key found for this signature in database
GPG Key ID: FAB12BE0575D999B

@ -55,6 +55,10 @@ LDFLAGS += -X helm.sh/helm/v3/internal/version.gitCommit=${GIT_COMMIT}
LDFLAGS += -X helm.sh/helm/v3/internal/version.gitTreeState=${GIT_DIRTY}
LDFLAGS += $(EXT_LDFLAGS)
# Define constants for the client-go version
LDFLAGS += -X helm.sh/helm/v3/pkg/lint/rules.k8sVersionMajor=$(shell awk '/client-go/{s=$$2;sub("^v","",s);split(s,v,".");print v[1]+1}' go.mod)
LDFLAGS += -X helm.sh/helm/v3/pkg/lint/rules.k8sVersionMinor=$(shell awk '/client-go/{s=$$2;sub("^v","",s);split(s,v,".");print v[2]}' go.mod)
.PHONY: all
all: build

@ -26,7 +26,8 @@ import (
)
const (
// This should be set based on the version of client-go being imported
// This should be set in the Makefile based on the version of client-go being imported.
// These constants will be overwritten with LDFLAGS
k8sVersionMajor = 1
k8sVersionMinor = 19
)

Loading…
Cancel
Save