move timeout handling to grpc_provider
simpleDiff is only called from the grpc_provider, and we always need to make sure the timeouts are encoded in the private data.
This commit is contained in:
parent
1bba574fe9
commit
2448d1d38b
|
@ -329,21 +329,13 @@ func (r *Resource) simpleDiff(
|
|||
c *terraform.ResourceConfig,
|
||||
meta interface{}) (*terraform.InstanceDiff, error) {
|
||||
|
||||
t := &ResourceTimeout{}
|
||||
err := t.ConfigDecode(r, c)
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("[ERR] Error decoding timeout: %s", err)
|
||||
}
|
||||
|
||||
instanceDiff, err := schemaMap(r.Schema).Diff(s, c, r.CustomizeDiff, meta, false)
|
||||
if err != nil {
|
||||
return instanceDiff, err
|
||||
}
|
||||
|
||||
if instanceDiff == nil {
|
||||
log.Printf("[DEBUG] Instance Diff is nil in SimpleDiff()")
|
||||
return nil, err
|
||||
instanceDiff = terraform.NewInstanceDiff()
|
||||
}
|
||||
|
||||
// Make sure the old value is set in each of the instance diffs.
|
||||
|
@ -357,10 +349,7 @@ func (r *Resource) simpleDiff(
|
|||
}
|
||||
}
|
||||
|
||||
if err := t.DiffEncode(instanceDiff); err != nil {
|
||||
log.Printf("[ERR] Error encoding timeout to instance diff: %s", err)
|
||||
}
|
||||
return instanceDiff, err
|
||||
return instanceDiff, nil
|
||||
}
|
||||
|
||||
// Validate validates the resource configuration against the schema.
|
||||
|
|
Loading…
Reference in New Issue