From 26053d5ab646ed1a14c7e4da839127b9ac242d04 Mon Sep 17 00:00:00 2001 From: iwilltry42 Date: Mon, 13 Jul 2020 11:58:42 +0200 Subject: [PATCH] add helperversionoverride --- Makefile | 2 +- version/version.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cda5aad7..a3c581dd 100644 --- a/Makefile +++ b/Makefile @@ -68,7 +68,7 @@ GO_SRC += $(foreach dir,$(REC_DIRS),$(shell find $(dir) -name "*.go")) ########## Required Tools ########## # Go Package required PKG_GOX := github.com/mitchellh/gox@v1.0.1 -PKG_GOLANGCI_LINT_VERSION := 1.25.0 +PKG_GOLANGCI_LINT_VERSION := 1.28.3 PKG_GOLANGCI_LINT_SCRIPT := https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh PKG_GOLANGCI_LINT := github.com/golangci/golangci-lint/cmd/golangci-lint@v${PKG_GOLANGCI_LINT_VERSION} diff --git a/version/version.go b/version/version.go index 31227c84..7964a48e 100644 --- a/version/version.go +++ b/version/version.go @@ -31,6 +31,9 @@ import ( // Version is the string that contains version var Version string +// HelperVersionOverride decouples the k3d helper image versions from the main version, if needed +var HelperVersionOverride string + // K3sVersion should contain the latest version tag of k3s (hardcoded at build time) // we're setting a default version for edge cases, because the 'latest' tag is not actively maintained var K3sVersion = "v1.18.4+k3s1" // TODO: can we try to dynamically fetch the latest version at runtime and only fallback to this if it fails? @@ -49,6 +52,9 @@ func GetHelperImageVersion() string { log.Infoln("Helper image tag set from env var") return tag } + if len(HelperVersionOverride) > 0 { + return HelperVersionOverride + } if len(Version) == 0 { return "latest" }