From 0867791324caa5a0934a174654d7ce5b4a0b34f8 Mon Sep 17 00:00:00 2001 From: Cezar Craciunoiu Date: Wed, 22 Jan 2025 14:37:30 +0200 Subject: [PATCH] fix(cloud): Filter out rootfs deployer if multiple found Signed-off-by: Cezar Craciunoiu --- internal/cli/kraft/cloud/deploy/deploy.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/cli/kraft/cloud/deploy/deploy.go b/internal/cli/kraft/cloud/deploy/deploy.go index 16c8ea6ce..4142f09e0 100644 --- a/internal/cli/kraft/cloud/deploy/deploy.go +++ b/internal/cli/kraft/cloud/deploy/deploy.go @@ -265,9 +265,15 @@ func (opts *DeployOptions) Run(ctx context.Context, args []string) error { } 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. + // We explicitly filter out the `rootfs` deployer because it's a more + // generic deployer which contextualizes the working directory + // without a `Kraftfile` and instead looks for compatible elements + // which can be generated into a rootfs, namely a `Dockerfile`. + // + // In the event that we are in this filter, there is more than one + // deployer, i.e. others which are higher priority. candidates = slices.DeleteFunc(candidates, func(d deployer) bool { - return d.String() == "" + return d.Name() == "rootfs" }) candidate, err := selection.Select[deployer]("multiple deployable contexts discovered: how would you like to proceed?", candidates...)