Skip to content

Commit

Permalink
Merge pull request #274 from FabianKramm/dev
Browse files Browse the repository at this point in the history
fix: remove v1.22 support for k3s
  • Loading branch information
FabianKramm authored Jan 6, 2022
2 parents 35e63f7 + fad3a99 commit d4c76b2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion charts/k3s/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 5 additions & 6 deletions cmd/vclusterctl/cmd/app/create/values/k3s.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -61,10 +60,10 @@ func getDefaultK3SReleaseValues(client kubernetes.Interface, createOptions *crea
var ok bool
image, ok = K3SVersionMap[serverVersionString]
if !ok {
if serverMinorInt > 22 {
log.Infof("officially unsupported host server version %s, will fallback to virtual cluster version v1.22", serverVersionString)
image = K3SVersionMap["1.22"]
serverVersionString = "1.22"
if serverMinorInt > 21 {
log.Infof("officially unsupported host server version %s, will fallback to virtual cluster version v1.21", serverVersionString)
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"]
Expand Down
2 changes: 1 addition & 1 deletion devspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ vars:
- name: SYNCER_IMAGE
value: ghcr.io/loft-sh/loft-enterprise/dev-vcluster
- name: K3S_IMAGE
value: rancher/k3s:v1.21.2-k3s1
value: rancher/k3s:v1.21.4-k3s1
# Replace this with your clusters service CIDR, you can find it out via
# kubectl apply -f hack/wrong-cluster-ip-service.yaml
- name: SERVICE_CIDR
Expand Down
5 changes: 2 additions & 3 deletions hack/build-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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);}')
Expand All @@ -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"
Expand All @@ -46,7 +45,7 @@ mkdir -p "${VCLUSTER_ROOT}/release"
cp -a "${VCLUSTER_ROOT}/assets/." "${VCLUSTER_ROOT}/release/"

# generate vcluster-images.txt
go run -mod vendor "${VCLUSTER_ROOT}/hack/assets/main.go" ${VERSION} > "${VCLUSTER_ROOT}/release/vcluster-images.txt"
go run -mod vendor "${VCLUSTER_ROOT}/hack/assets/main.go" ${RELEASE_VERSION} > "${VCLUSTER_ROOT}/release/vcluster-images.txt"

for OS in ${VCLUSTER_BUILD_PLATFORMS[@]}; do
for ARCH in ${VCLUSTER_BUILD_ARCHS[@]}; do
Expand Down

0 comments on commit d4c76b2

Please sign in to comment.