Structured Renderer: use the new renderer when rendering the state in addition to the plan (#32629)

* Use the new renderer when rendering the state

* remove confusing and unneeded comment
This commit is contained in:
Liam Cervante
2023-02-07 09:14:14 +01:00
committed by GitHub
parent c70244426a
commit d818d7850d
31 changed files with 1311 additions and 613 deletions

View File

@@ -39,9 +39,6 @@ const (
ResourceInstanceDeleteBecauseNoMoveTarget = "delete_because_no_move_target"
ResourceInstanceReadBecauseConfigUnknown = "read_because_config_unknown"
ResourceInstanceReadBecauseDependencyPending = "read_because_dependency_pending"
ManagedResourceMode = "managed"
DataResourceMode = "data"
)
// Plan is the top-level representation of the json format of a plan. It includes
@@ -448,9 +445,9 @@ func MarshalResourceChanges(resources []*plans.ResourceInstanceChangeSrc, schema
switch addr.Resource.Resource.Mode {
case addrs.ManagedResourceMode:
r.Mode = ManagedResourceMode
r.Mode = jsonstate.ManagedResourceMode
case addrs.DataResourceMode:
r.Mode = DataResourceMode
r.Mode = jsonstate.DataResourceMode
default:
return nil, fmt.Errorf("resource %s has an unsupported mode %s", r.Address, addr.Resource.Resource.Mode.String())
}