Skip to content

Commit

Permalink
pass params
Browse files Browse the repository at this point in the history
  • Loading branch information
Josef Karasek committed Aug 17, 2023
1 parent fb16ffe commit 08b83d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 4 additions & 2 deletions internal/cli/migrate/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ func migrate(ctx context.Context, status *printer.StatusPrinter, opts Options, b
continue
}
}
status.End(true)

if errs.ErrorOrNil() != nil {
return "", fmt.Errorf("while migrating aliases: %w%s", errs.ErrorOrNil(), errStateMessage(opts.CloudDashboardURL, mutation.CreateDeployment.ID))
Expand All @@ -145,7 +146,7 @@ func migrate(ctx context.Context, status *printer.StatusPrinter, opts Options, b
}

installConfig := install.Config{
HelmParams: parseHelmCommand(mutation.CreateDeployment.InstallUpgradeInstructions),
HelmParams: parseHelmCommand(mutation.CreateDeployment.InstallUpgradeInstructions, opts.AutoApprove),
Watch: opts.Watch,
Timeout: opts.Timeout,
}
Expand Down Expand Up @@ -294,7 +295,7 @@ func waitForMigrationJob(ctx context.Context, k8sCli *kubernetes.Clientset, opts
}
}

func parseHelmCommand(instructions []*gqlModel.InstallUpgradeInstructionsForPlatform) helm.Config {
func parseHelmCommand(instructions []*gqlModel.InstallUpgradeInstructionsForPlatform, autoApprove bool) helm.Config {
// platform := runtime.GOOS
var raw string
if len(instructions) > 1 {
Expand All @@ -320,6 +321,7 @@ func parseHelmCommand(instructions []*gqlModel.InstallUpgradeInstructionsForPlat
ReleaseName: helm.ReleaseName,
ChartName: helm.HelmChartName,
RepoLocation: helm.HelmRepoStable,
AutoApprove: autoApprove,
}
}

Expand Down
5 changes: 1 addition & 4 deletions internal/cli/migrate/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ package migrate

import (
"time"

"github.com/kubeshop/botkube/internal/cli/install/helm"
)

// Options holds migrate possible configuration options.
type Options struct {
Timeout time.Duration
Watch bool
Token string
InstanceName string `survey:"instanceName"`
CloudDashboardURL string
Expand All @@ -19,8 +18,6 @@ type Options struct {
SkipOpenBrowser bool
AutoApprove bool
ConfigExporter ConfigExporterOptions
HelmParams helm.Config
Watch bool
}

// ConfigExporterOptions holds config exporter image configuration options.
Expand Down

0 comments on commit 08b83d4

Please sign in to comment.