From 2a9d8b7ac99d3462924ea991402de6faf6762a62 Mon Sep 17 00:00:00 2001 From: Fraser Waters Date: Wed, 23 Nov 2022 08:52:43 +0000 Subject: [PATCH] Only use preview plans for --yes in experimental mode --- pkg/backend/apply.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/backend/apply.go b/pkg/backend/apply.go index c0f7e8725852..6c985c55c5fb 100644 --- a/pkg/backend/apply.go +++ b/pkg/backend/apply.go @@ -122,6 +122,11 @@ func PreviewThenPrompt(ctx context.Context, kind apitype.UpdateKind, stack Stack // If there are no changes, or we're auto-approving or just previewing, we can skip the confirmation prompt. if op.Opts.AutoApprove || kind == apitype.PreviewUpdate { close(eventsChannel) + // If we're running in experimental mode then return the plan generated, else discard it. The user may + // be explicitly setting a plan but that's handled higher up the call stack. + if !op.Opts.Engine.Experimental { + plan = nil + } return plan, changes, nil }