Skip to content

Commit

Permalink
fix(cloud): Remove empty deployer before checking candidates
Browse files Browse the repository at this point in the history
Signed-off-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
  • Loading branch information
craciunoiuc committed Sep 18, 2024
1 parent cf75c64 commit ecabd29
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/cli/kraft/cloud/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,16 @@ func (opts *DeployOptions) Run(ctx context.Context, args []string) error {
}
}

// Remove any candidates that do not have String prompts.
candidates = slices.DeleteFunc(candidates, func(d deployer) bool {
return d.String() == ""
})

if len(candidates) == 0 {
return fmt.Errorf("could not determine how to run provided input: %w", errors.Join(errs...))
} else if len(candidates) == 1 {
d = candidates[0]
} else if !config.G[config.KraftKit](ctx).NoPrompt {
// Remove any candidates that do not have String prompts.
candidates = slices.DeleteFunc(candidates, func(d deployer) bool {
return d.String() == ""
})

candidate, err := selection.Select[deployer]("multiple deployable contexts discovered: how would you like to proceed?", candidates...)
if err != nil {
return err
Expand Down

0 comments on commit ecabd29

Please sign in to comment.