-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Dipankar Das <[email protected]>
- Loading branch information
1 parent
336fc65
commit dc81a5f
Showing
2 changed files
with
35 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,6 @@ import ( | |
"github.com/ksctl/ksctl/v2/pkg/handler/cluster/controller" | ||
Check failure on line 24 in cmd/create.go
|
||
controllerMeta "github.com/ksctl/ksctl/v2/pkg/handler/cluster/metadata" | ||
Check failure on line 25 in cmd/create.go
|
||
"github.com/ksctl/ksctl/v2/pkg/provider" | ||
Check failure on line 26 in cmd/create.go
|
||
"github.com/pterm/pterm" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
@@ -81,33 +80,32 @@ ksctl create --help | |
os.Exit(1) | ||
} | ||
|
||
ss := cli.GetSpinner() | ||
ss.Start("Fetching the region list") | ||
|
||
regions, err := managerClient.ListAllRegions() | ||
if err != nil { | ||
ss.StopWithFailure("Failed to fetch the region list", "Reason", err) | ||
k.l.Error("Failed to sync the metadata", "Reason", err) | ||
os.Exit(1) | ||
} | ||
ss.StopWithSuccess("Fetched the region list") | ||
|
||
if v, ok := k.getSelectedRegion(regions); !ok { | ||
os.Exit(1) | ||
} else { | ||
meta.Region = v | ||
} | ||
spinner := pterm.DefaultSpinner | ||
// give me the snake spinnner here | ||
spinner.Sequence = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"} | ||
ss, err := spinner.Start("Please wait, fetching the instance types") | ||
if err != nil { | ||
k.l.Error("Failed to start the spinner", "Reason", err) | ||
os.Exit(1) | ||
} | ||
ss = cli.GetSpinner() | ||
ss.Start("Fetching the instance type list") | ||
|
||
vms, err := managerClient.ListAllInstances(meta.Region) | ||
if err != nil { | ||
ss.Fail(fmt.Sprintf("Unable to get instance_type list: %v", err)) | ||
ss.StopWithFailure("Failed to fetch the instance type list", "Reason", err) | ||
k.l.Error("Failed to sync the metadata", "Reason", err) | ||
os.Exit(1) | ||
} | ||
ss.Success("Fetched the instance type list") | ||
ss.StopWithSuccess("Fetched the instance type list") | ||
if v, ok := k.getSelectedInstanceType(vms); !ok { | ||
os.Exit(1) | ||
} else { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters