Skip to content

Commit

Permalink
fix(get,switch)!: missing storageProvider
Browse files Browse the repository at this point in the history
Signed-off-by: Dipankar Das <[email protected]>
  • Loading branch information
dipankardas011 committed May 30, 2024
1 parent 66de12f commit 185448c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cli/cmd/getCluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,17 @@ ksctl get-clusters `,
}
SetRequiredFeatureFlags(ctx, log, cmd)
cli.Client.Metadata.Provider = consts.KsctlCloud(provider)
cli.Client.Metadata.StateLocation = consts.KsctlStore(storage)

m, err := controllers.NewManagerClusterKsctl(
ctx,
log,
&cli.Client,
)
if err != nil {
log.Error(ctx, "failed to init", "Reason", err)
os.Exit(1)
}

err = m.GetCluster()
if err != nil {
Expand Down
6 changes: 5 additions & 1 deletion cli/cmd/switchCluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ ksctl switch-context -p <civo,local,ha-civo,ha-azure,ha-aws,azure> -n <clustern

cli.Client.Metadata.ClusterName = clusterName
cli.Client.Metadata.Region = region
cli.Client.Metadata.StateLocation = consts.KsctlStore(storage)

switch provider {
case string(consts.CloudLocal):
Expand Down Expand Up @@ -61,7 +62,10 @@ ksctl switch-context -p <civo,local,ha-civo,ha-azure,ha-aws,azure> -n <clustern
log,
&cli.Client,
)

if err != nil {
log.Error(ctx, "failed to init", "Reason", err)
os.Exit(1)
}
kubeconfig, err := m.SwitchCluster()
if err != nil {
log.Error(ctx, "Switch cluster failed", "Reason", err)
Expand Down

0 comments on commit 185448c

Please sign in to comment.