Reordering so attributes are first (understandability)
This commit is contained in:
parent
e44e03b283
commit
ee9ec8a193
|
@ -954,6 +954,16 @@ func markProviderSensitiveAttributes(schema *configschema.Block, val cty.Value)
|
||||||
|
|
||||||
func getValMarks(schema *configschema.Block, val cty.Value, path cty.Path) []cty.PathValueMarks {
|
func getValMarks(schema *configschema.Block, val cty.Value, path cty.Path) []cty.PathValueMarks {
|
||||||
var pvm []cty.PathValueMarks
|
var pvm []cty.PathValueMarks
|
||||||
|
for name, attrS := range schema.Attributes {
|
||||||
|
if attrS.Sensitive {
|
||||||
|
attrPath := append(path, cty.GetAttrStep{Name: name})
|
||||||
|
pvm = append(pvm, cty.PathValueMarks{
|
||||||
|
Path: attrPath,
|
||||||
|
Marks: cty.NewValueMarks("sensitive"),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for name, blockS := range schema.BlockTypes {
|
for name, blockS := range schema.BlockTypes {
|
||||||
// If our block doesn't contain any sensitive attributes, skip inspecting it
|
// If our block doesn't contain any sensitive attributes, skip inspecting it
|
||||||
if !blockS.Block.ContainsSensitive() {
|
if !blockS.Block.ContainsSensitive() {
|
||||||
|
@ -980,15 +990,5 @@ func getValMarks(schema *configschema.Block, val cty.Value, path cty.Path) []cty
|
||||||
panic(fmt.Sprintf("unsupported nesting mode %s", blockS.Nesting))
|
panic(fmt.Sprintf("unsupported nesting mode %s", blockS.Nesting))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for name, attrS := range schema.Attributes {
|
|
||||||
if attrS.Sensitive {
|
|
||||||
attrPath := append(path, cty.GetAttrStep{Name: name})
|
|
||||||
pvm = append(pvm, cty.PathValueMarks{
|
|
||||||
Path: attrPath,
|
|
||||||
Marks: cty.NewValueMarks("sensitive"),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return pvm
|
return pvm
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue