func (c *upgradeCmd) Run(insCtx *install.Context) error {
	params, err := c.parser.Parse()
	if err != nil {
		return errors.Wrap(err, errParseUpgradeParameters)
	}
	return c.mgr.Upgrade(c.Version, params)
}
Run executes the upgrade command.
package uxp
import (
	"io"
	"github.com/pkg/errors"
	"sigs.k8s.io/yaml"
	"github.com/upbound/up/internal/install"
	"github.com/upbound/up/internal/install/helm"
)
const (
	errParseUpgradeParameters = "unable to parse upgrade parameters"
)
func (c *upgradeCmd) AfterApply(insCtx *install.Context) error {
	repo := uxpRepoURL
	if c.Unstable {
		repo = uxpUnstableRepoURL
	}
	ins, err := helm.NewManager(insCtx.Kubeconfig,
		chartName,
		repo,
		helm.WithNamespace(insCtx.Namespace),
		helm.WithChart(c.Bundle),
		helm.WithAlternateChart(alternateChartName),
		helm.RollbackOnError(c.Rollback),
		helm.Force(c.Force))
	if err != nil {
		return err
	}
	c.mgr = ins
	base := map[string]interface{}{}
	if c.File != nil {
		defer c.File.Close()  
		b, err := io.ReadAll(c.File)
		if err != nil {
			return errors.Wrap(err, errReadParametersFile)
		}
		if err := yaml.Unmarshal(b, &base); err != nil {
			return errors.Wrap(err, errReadParametersFile)
		}
		if err := c.File.Close(); err != nil {
			return errors.Wrap(err, errReadParametersFile)
		}
	}
	c.parser = helm.NewParser(base, c.Set)
	return nil
}
type upgradeCmd struct {
	mgr    install.Manager
	parser install.ParameterParser
	Version string `arg:"" optional:"" help:"UXP version to upgrade to."`
	Rollback bool `help:"Rollback to previously installed version on failed upgrade."`
	Force    bool `help:"Force upgrade even if versions are incompatible."`
	Unstable bool `help:"Allow installing unstable versions."`
	install.CommonParams
}