Skip to content

Commit

Permalink
Adding a small fix to the Same() func
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Sander van Harmelen committed Dec 16, 2014
1 parent 462cc24 commit d24ab68
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions terraform/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,15 @@ func (d *InstanceDiff) Same(d2 *InstanceDiff) bool {
}
}

// 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.
if diffOld.NewComputed && strings.HasSuffix(k, ".#") {
ok = true
}

if !ok {
return false
}
Expand Down

0 comments on commit d24ab68

Please sign in to comment.