Skip to content

Commit

Permalink
fix: use correct chart name for vcluster platform start
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianKramm committed Sep 11, 2024
1 parent a84333a commit 5e71d62
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmd/vclusterctl/cmd/platform/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package platform
import (
"context"
"fmt"
"strings"

"github.com/blang/semver"
"github.com/loft-sh/log"
"github.com/loft-sh/log/survey"
"github.com/loft-sh/log/terminal"
Expand Down Expand Up @@ -83,6 +85,15 @@ func (cmd *StartCmd) Run(ctx context.Context) error {
cmd.Version = latestVersion
}
}

// if < v4.0.0 then use ChartName loft
parsedVersion, err := semver.Parse(strings.TrimPrefix(cmd.Version, "v"))
if err != nil {
return fmt.Errorf("parse provided version %s: %w", cmd.Version, err)
} else if parsedVersion.LT(semver.MustParse("4.0.0-alpha.0")) && cmd.ChartName == "vcluster-platform" {
cmd.ChartName = "loft"
}

// make sure we are in the correct context
// first load the kube config
kubeClientConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(clientcmd.NewDefaultClientConfigLoadingRules(), &clientcmd.ConfigOverrides{
Expand Down

0 comments on commit 5e71d62

Please sign in to comment.