add helperversionoverride

pull/300/head
iwilltry42 4 years ago
parent c38e5cef34
commit 26053d5ab6
No known key found for this signature in database
GPG Key ID: 7BA57AD1CFF16110
  1. 2
      Makefile
  2. 6
      version/version.go

@ -68,7 +68,7 @@ GO_SRC += $(foreach dir,$(REC_DIRS),$(shell find $(dir) -name "*.go"))
########## Required Tools ########## ########## Required Tools ##########
# Go Package required # Go Package required
PKG_GOX := github.com/mitchellh/gox@v1.0.1 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_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} PKG_GOLANGCI_LINT := github.com/golangci/golangci-lint/cmd/golangci-lint@v${PKG_GOLANGCI_LINT_VERSION}

@ -31,6 +31,9 @@ import (
// Version is the string that contains version // Version is the string that contains version
var Version string 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) // 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 // 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? 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") log.Infoln("Helper image tag set from env var")
return tag return tag
} }
if len(HelperVersionOverride) > 0 {
return HelperVersionOverride
}
if len(Version) == 0 { if len(Version) == 0 {
return "latest" return "latest"
} }

Loading…
Cancel
Save