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

Don't print the update plan message if using --json #11454

Merged
merged 1 commit into from Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,4 @@
changes:
- type: fix
scope: cli
description: Don't print update plan message with --json.
18 changes: 10 additions & 8 deletions pkg/cmd/pulumi/preview.go
Expand Up @@ -261,14 +261,16 @@ func newPreviewCmd() *cobra.Command {
return result.FromError(err)
}

// Write out message on how to use the plan
var buf bytes.Buffer
fprintf(&buf, "Update plan written to '%s'", planFilePath)
fprintf(
&buf,
"\nRun `pulumi up --plan='%s'` to constrain the update to the operations planned by this preview",
planFilePath)
cmdutil.Diag().Infof(diag.RawMessage("" /*urn*/, buf.String()))
// Write out message on how to use the plan (if not writing out --json)
if !jsonDisplay {
var buf bytes.Buffer
fprintf(&buf, "Update plan written to '%s'", planFilePath)
fprintf(
&buf,
"\nRun `pulumi up --plan='%s'` to constrain the update to the operations planned by this preview",
planFilePath)
cmdutil.Diag().Infof(diag.RawMessage("" /*urn*/, buf.String()))
}
}
return nil
}
Expand Down