Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cloud): Remove empty deployer before checking candidates #1892

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading