Skip to content

Commit

Permalink
Show warnings even if no changes
Browse files Browse the repository at this point in the history
Fixes hashicorp#22541

This change will print warnings, such as deprecations,
even if plan has no changes.
  • Loading branch information
nyurik committed Feb 13, 2020
1 parent 7bd662d commit cfad642
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions backend/local/backend_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,19 +162,20 @@ func (b *Local) opPlan(

if plan.Changes.Empty() {
b.CLI.Output("\n" + b.Colorize().Color(strings.TrimSpace(planNoChanges)))
return
} else {
// Only print plan if it is not empty
b.renderPlan(plan, baseState, schemas)
}

b.renderPlan(plan, baseState, schemas)

// If we've accumulated any warnings along the way then we'll show them
// here just before we show the summary and next steps. If we encountered
// errors then we would've returned early at some other point above.
// Note that diagnostics will be shown even if there are no changes.
b.ShowDiagnostics(diags)

// Give the user some next-steps, unless we're running in an automation
// tool which is presumed to provide its own UI for further actions.
if !b.RunningInAutomation {
if !plan.Changes.Empty() && !b.RunningInAutomation {

b.CLI.Output("\n------------------------------------------------------------------------")

Expand Down

0 comments on commit cfad642

Please sign in to comment.