Skip to content

Commit d24ab68

Browse files
author
Sander van Harmelen
committed
Adding a small fix to the Same() func
This is a little tricky, but when a diff contains a computed list or set that can only be interpolated after the apply command has created the dependant resources, it could turn out that the result is actually the same as the existing state which would remove the key from the diff
1 parent 462cc24 commit d24ab68

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎terraform/diff.go‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,15 @@ func (d *InstanceDiff) Same(d2 *InstanceDiff) bool {
438438
}
439439
}
440440

441+
// This is a little tricky, but when a diff contains a computed list
442+
// or set that can only be interpolated after the apply command has
443+
// created the dependant resources, it could turn out that the result
444+
// is actually the same as the existing state which would remove the
445+
// key from the diff.
446+
if diffOld.NewComputed && strings.HasSuffix(k, ".#") {
447+
ok = true
448+
}
449+
441450
if !ok {
442451
return false
443452
}

0 commit comments

Comments
 (0)