diff --git a/pkg/upgrade/upgrade.go b/pkg/upgrade/upgrade.go index 5de9fcb2a..d2416749e 100644 --- a/pkg/upgrade/upgrade.go +++ b/pkg/upgrade/upgrade.go @@ -113,8 +113,14 @@ func NewerVersionAvailable() string { // Upgrade downloads the latest release from github and replaces vcluster if a new version is found func Upgrade(flagVersion string, log log.Logger) error { + updater, err := selfupdate.NewUpdater(selfupdate.Config{ + Filters: []string{"vcluster"}, + }) + if err != nil { + return fmt.Errorf("failed to initialize updater: %w", err) + } if flagVersion != "" { - release, found, err := selfupdate.DetectVersion(githubSlug, flagVersion) + release, found, err := updater.DetectVersion(githubSlug, flagVersion) if err != nil { return errors.Wrap(err, "find version") } else if !found { @@ -127,7 +133,7 @@ func Upgrade(flagVersion string, log log.Logger) error { } log.Infof("Downloading version %s...", flagVersion) - err = selfupdate.DefaultUpdater().UpdateTo(release, cmdPath) + err = updater.UpdateTo(release, cmdPath) if err != nil { return err } @@ -148,7 +154,7 @@ func Upgrade(flagVersion string, log log.Logger) error { v := semver.MustParse(version) log.Info("Downloading newest version...") - latest, err := selfupdate.UpdateSelf(v, githubSlug) + latest, err := updater.UpdateSelf(v, githubSlug) if err != nil { return err }