mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-25 01:00:16 -05:00
New plans.Quality type for display-relevant facts about a plan
This commit replaces the existing jsonformat.PlanRendererOpt type with a new type with identical semantics, located in the plans package. We needed to be able to exchange the facts represented by `jsonformat.PlanRendererOpt` across some package boundaries, but the jsonformat package is implicated in too many dependency chains to be safe for that purpose! So, we had to make a new one. The plans package seems safe to import from all the places that must emit or accept this info, and already contains plans.Mode, which is effectively a sibling of this type.
This commit is contained in:
committed by
Sebastian Rivera
parent
da963a13b9
commit
0df3c143bb
@@ -67,12 +67,12 @@ func (v *ShowHuman) Display(config *configs.Config, plan *plans.Plan, stateFile
|
||||
RelevantAttributes: attrs,
|
||||
}
|
||||
|
||||
var opts []jsonformat.PlanRendererOpt
|
||||
var opts []plans.Quality
|
||||
if !plan.CanApply() {
|
||||
opts = append(opts, jsonformat.CanNotApply)
|
||||
opts = append(opts, plans.NoChanges)
|
||||
}
|
||||
if plan.Errored {
|
||||
opts = append(opts, jsonformat.Errored)
|
||||
opts = append(opts, plans.Errored)
|
||||
}
|
||||
|
||||
renderer.RenderHumanPlan(jplan, plan.UIMode, opts...)
|
||||
|
||||
Reference in New Issue
Block a user