Add support for sets in the structured renderer (#32409)

* prep for processing the structured run output

* undo unwanted change to a json key

* Add skeleton functions and API for refactored renderer

* goimports

* Fix documentation of the RenderOpts struct

* Add rendering functionality for primitives to the structured renderer

* add test case for override

* Add support for parsing and rendering sensitive values in the renderer

* Add support for unknown/computed values in the structured renderer

* delete missing unit tests

* Add support for object attributes in the structured renderer

* goimports

* Add support for the replace paths data in the structured renderer

* Add support for maps in the structured renderer

* Add support for lists in the structured renderer

* goimports

* Add support for sets in the structured renderer

* goimports
This commit is contained in:
Liam Cervante
2023-01-09 14:17:30 +01:00
committed by GitHub
parent aff94591c1
commit 69cce3597f
7 changed files with 870 additions and 15 deletions

View File

@@ -23,6 +23,8 @@ func (v Value) computeChangeForNestedAttribute(attribute *jsonprovider.NestedTyp
return v.computeAttributeChangeAsNestedMap(attribute.Attributes)
case "list":
return v.computeAttributeChangeAsNestedList(attribute.Attributes)
case "set":
return v.computeAttributeChangeAsNestedSet(attribute.Attributes)
default:
panic("unrecognized nesting mode: " + attribute.NestingMode)
}
@@ -38,6 +40,8 @@ func (v Value) computeChangeForType(ctyType cty.Type) change.Change {
return v.computeAttributeChangeAsMap(ctyType.ElementType())
case ctyType.IsListType():
return v.computeAttributeChangeAsList(ctyType.ElementType())
case ctyType.IsSetType():
return v.computeAttributeChangeAsSet(ctyType.ElementType())
default:
panic("unrecognized type: " + ctyType.FriendlyName())
}