helper/diff: mark removed keys as removed
This commit is contained in:
parent
2d97738636
commit
96e09440d4
|
@ -58,6 +58,9 @@ func testResourceDiffStr(rd *terraform.ResourceDiff) string {
|
||||||
if attrDiff.NewComputed {
|
if attrDiff.NewComputed {
|
||||||
v = "<computed>"
|
v = "<computed>"
|
||||||
}
|
}
|
||||||
|
if attrDiff.NewRemoved {
|
||||||
|
v = "<removed>"
|
||||||
|
}
|
||||||
|
|
||||||
newResource := ""
|
newResource := ""
|
||||||
if attrDiff.RequiresNew {
|
if attrDiff.RequiresNew {
|
||||||
|
|
|
@ -115,9 +115,9 @@ func (b *ResourceBuilder) Diff(
|
||||||
}
|
}
|
||||||
for k, _ := range matchingKeys {
|
for k, _ := range matchingKeys {
|
||||||
attrs[k] = &terraform.ResourceAttrDiff{
|
attrs[k] = &terraform.ResourceAttrDiff{
|
||||||
Old: s.Attributes[k],
|
Old: s.Attributes[k],
|
||||||
New: "",
|
NewRemoved: true,
|
||||||
Type: terraform.DiffAttrInput,
|
Type: terraform.DiffAttrInput,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -240,7 +240,7 @@ const testRBComplexDiff = `UPDATE
|
||||||
`
|
`
|
||||||
|
|
||||||
const testRBComplexReplaceDiff = `UPDATE
|
const testRBComplexReplaceDiff = `UPDATE
|
||||||
IN listener.0.port: "80" => ""
|
IN listener.0.port: "80" => "<removed>"
|
||||||
IN listener.0.value: "" => "50"
|
IN listener.0.value: "" => "50"
|
||||||
`
|
`
|
||||||
|
|
||||||
|
|
|
@ -165,6 +165,7 @@ type ResourceAttrDiff struct {
|
||||||
Old string // Old Value
|
Old string // Old Value
|
||||||
New string // New Value
|
New string // New Value
|
||||||
NewComputed bool // True if new value is computed (unknown currently)
|
NewComputed bool // True if new value is computed (unknown currently)
|
||||||
|
NewRemoved bool // True if this attribute is being removed
|
||||||
NewExtra interface{} // Extra information for the provider
|
NewExtra interface{} // Extra information for the provider
|
||||||
RequiresNew bool // True if change requires new resource
|
RequiresNew bool // True if change requires new resource
|
||||||
Type DiffAttrType
|
Type DiffAttrType
|
||||||
|
|
Loading…
Reference in New Issue