helper/schema: diff floats properly
/cc @phinze - This is pretty straightforward, almost magically so. The reason this works is because in `diffString` we use mapstructure[1] with "weak decode mode" to just be responisble for turning anything into a string. [1]: https://github.com/mitchellh/mapstructure
This commit is contained in:
parent
6fadebc5d8
commit
241fc5bb39
|
@ -466,6 +466,8 @@ func (m schemaMap) diff(
|
||||||
fallthrough
|
fallthrough
|
||||||
case TypeInt:
|
case TypeInt:
|
||||||
fallthrough
|
fallthrough
|
||||||
|
case TypeFloat:
|
||||||
|
fallthrough
|
||||||
case TypeString:
|
case TypeString:
|
||||||
err = m.diffString(k, schema, diff, d, all)
|
err = m.diffString(k, schema, diff, d, all)
|
||||||
case TypeList:
|
case TypeList:
|
||||||
|
|
|
@ -1790,7 +1790,7 @@ func TestSchemaMap_Diff(t *testing.T) {
|
||||||
|
|
||||||
Diff: &terraform.InstanceDiff{
|
Diff: &terraform.InstanceDiff{
|
||||||
Attributes: map[string]*terraform.ResourceAttrDiff{
|
Attributes: map[string]*terraform.ResourceAttrDiff{
|
||||||
"port": &terraform.ResourceAttrDiff{
|
"some_threshold": &terraform.ResourceAttrDiff{
|
||||||
Old: "567.8",
|
Old: "567.8",
|
||||||
New: "12.34",
|
New: "12.34",
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue