From 00e7b1b9b3b78cce69eca5fd530114b689736c42 Mon Sep 17 00:00:00 2001 From: fabiankramm Date: Thu, 6 Jan 2022 14:08:04 +0100 Subject: [PATCH] fix: backport k3s removal --- charts/k3s/values.yaml | 2 +- cmd/vclusterctl/cmd/app/create/values/k3s.go | 9 ++++----- hack/build-cli.sh | 3 +-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/charts/k3s/values.yaml b/charts/k3s/values.yaml index 578ada388..8d4762b3a 100644 --- a/charts/k3s/values.yaml +++ b/charts/k3s/values.yaml @@ -33,7 +33,7 @@ syncer: # Virtual Cluster (k3s) configuration vcluster: # Image to use for the virtual cluster - image: rancher/k3s:v1.22.2-k3s1 + image: rancher/k3s:v1.21.4-k3s1 command: - /bin/k3s baseArgs: diff --git a/cmd/vclusterctl/cmd/app/create/values/k3s.go b/cmd/vclusterctl/cmd/app/create/values/k3s.go index b6b05e973..4cc103517 100644 --- a/cmd/vclusterctl/cmd/app/create/values/k3s.go +++ b/cmd/vclusterctl/cmd/app/create/values/k3s.go @@ -15,8 +15,7 @@ import ( ) var K3SVersionMap = map[string]string{ - "1.22": "rancher/k3s:v1.22.2-k3s2", - "1.21": "rancher/k3s:v1.21.5-k3s2", + "1.21": "rancher/k3s:v1.21.4-k3s1", "1.20": "rancher/k3s:v1.20.11-k3s2", "1.19": "rancher/k3s:v1.19.13-k3s1", "1.18": "rancher/k3s:v1.18.20-k3s1", @@ -61,10 +60,10 @@ func getDefaultK3SReleaseValues(client kubernetes.Interface, createOptions *crea var ok bool image, ok = K3SVersionMap[serverVersionString] if !ok { - if serverMinorInt > 22 { + if serverMinorInt > 21 { log.Infof("officially unsupported host server version %s, will fallback to virtual cluster version v1.22", serverVersionString) - image = K3SVersionMap["1.22"] - serverVersionString = "1.22" + image = K3SVersionMap["1.21"] + serverVersionString = "1.21" } else { log.Infof("officially unsupported host server version %s, will fallback to virtual cluster version v1.16", serverVersionString) image = K3SVersionMap["1.16"] diff --git a/hack/build-cli.sh b/hack/build-cli.sh index 08cface4c..2bd77376a 100644 --- a/hack/build-cli.sh +++ b/hack/build-cli.sh @@ -13,7 +13,6 @@ export GOFLAGS=-mod=vendor # go mod vendor VCLUSTER_ROOT=$(git rev-parse --show-toplevel) -VERSION=$(git describe --tags $(git rev-list --tags --max-count=1)) COMMIT_HASH=$(git rev-parse --short HEAD 2>/dev/null) DATE=$(date "+%Y-%m-%d") BUILD_PLATFORM=$(uname -a | awk '{print tolower($1);}') @@ -29,7 +28,7 @@ if [[ "$(pwd)" != "${VCLUSTER_ROOT}" ]]; then fi GO_BUILD_CMD="go build -a" -GO_BUILD_LDFLAGS="-s -w -X main.commitHash=${COMMIT_HASH} -X main.buildDate=${DATE} -X main.version=${VERSION}" +GO_BUILD_LDFLAGS="-s -w -X main.commitHash=${COMMIT_HASH} -X main.buildDate=${DATE} -X main.version=${RELEASE_VERSION}" if [[ -z "${VCLUSTER_BUILD_PLATFORMS}" ]]; then VCLUSTER_BUILD_PLATFORMS="linux windows darwin"