state: cache should use State.Equal to check equality
reflect.DeepEqual was returning false, sometimes.
This commit is contained in:
parent
c9fe0c1b34
commit
1fac7b6488
|
@ -1,6 +1,9 @@
|
|||
## 0.4.1 (unreleased)
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
* command/remote-config: remove spurrious error "nil" when initializing
|
||||
remote state on a new configuration. [GH-1392]
|
||||
|
||||
## 0.4.0 (April 2, 2015)
|
||||
|
||||
|
|
|
@ -255,8 +255,8 @@ func remoteState(
|
|||
"Error preparing remote state: {{err}}", err)
|
||||
}
|
||||
default:
|
||||
return nil, errwrap.Wrapf(
|
||||
"Error initilizing remote state: {{err}}", err)
|
||||
return nil, fmt.Errorf(
|
||||
"Unknown refresh result: %s", cache.RefreshResult())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package state
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
"github.com/hashicorp/terraform/terraform"
|
||||
)
|
||||
|
@ -77,7 +76,7 @@ func (s *CacheState) RefreshState() error {
|
|||
s.refreshResult = CacheRefreshUpdateLocal
|
||||
case durable.Serial == cached.Serial:
|
||||
// They're supposedly equal, verify.
|
||||
if reflect.DeepEqual(cached, durable) {
|
||||
if cached.Equal(durable) {
|
||||
// Hashes are the same, everything is great
|
||||
s.refreshResult = CacheRefreshNoop
|
||||
break
|
||||
|
|
Loading…
Reference in New Issue