Merge pull request #734 from pulumi/CheckOldIns
Only pass old inputs to `Check`.
This commit is contained in:
commit
038f5ae806
1 changed files with 4 additions and 4 deletions
|
@ -281,10 +281,10 @@ func (iter *PlanIterator) makeRegisterResouceSteps(e RegisterResourceEvent) ([]S
|
||||||
// Check for an old resource before going any further.
|
// Check for an old resource before going any further.
|
||||||
old, hasold := iter.p.Olds()[urn]
|
old, hasold := iter.p.Olds()[urn]
|
||||||
var olds resource.PropertyMap
|
var olds resource.PropertyMap
|
||||||
var oldouts resource.PropertyMap
|
var oldState resource.PropertyMap
|
||||||
if hasold {
|
if hasold {
|
||||||
olds = old.Inputs
|
olds = old.Inputs
|
||||||
oldouts = old.All()
|
oldState = old.All()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetch the provider for this resource type, assuming it isn't just a logical one.
|
// Fetch the provider for this resource type, assuming it isn't just a logical one.
|
||||||
|
@ -300,7 +300,7 @@ func (iter *PlanIterator) makeRegisterResouceSteps(e RegisterResourceEvent) ([]S
|
||||||
news, inputs := new.Inputs, new.Inputs
|
news, inputs := new.Inputs, new.Inputs
|
||||||
if prov != nil {
|
if prov != nil {
|
||||||
var failures []plugin.CheckFailure
|
var failures []plugin.CheckFailure
|
||||||
inputs, failures, err = prov.Check(urn, oldouts, news)
|
inputs, failures, err = prov.Check(urn, olds, news)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else if iter.issueCheckErrors(new, urn, failures) {
|
} else if iter.issueCheckErrors(new, urn, failures) {
|
||||||
|
@ -354,7 +354,7 @@ func (iter *PlanIterator) makeRegisterResouceSteps(e RegisterResourceEvent) ([]S
|
||||||
// The properties changed; we need to figure out whether to do an update or replacement.
|
// The properties changed; we need to figure out whether to do an update or replacement.
|
||||||
var diff plugin.DiffResult
|
var diff plugin.DiffResult
|
||||||
if prov != nil {
|
if prov != nil {
|
||||||
if diff, err = prov.Diff(urn, old.ID, oldouts, inputs); err != nil {
|
if diff, err = prov.Diff(urn, old.ID, oldState, inputs); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue