core: Generate "provider bug" warnings only if no errors from provider
We can be more relaxed about our rules that a create musn't return null or a destroy must return null if the provider also itself indicated an error. In that case, it's expected that the return value is describing a partial result, and so we'll just store it and move on.
This commit is contained in:
parent
f63bba78c9
commit
31c412b44d
|
@ -158,6 +158,7 @@ func (n *EvalApply) Eval(ctx EvalContext) (interface{}, error) {
|
|||
// we still want to save that but it often causes some confusing behaviors
|
||||
// where it seems like Terraform is failing to take any action at all,
|
||||
// so we'll generate some errors to draw attention to it.
|
||||
if !applyDiags.HasErrors() {
|
||||
if change.Action == plans.Delete && !newVal.IsNull() {
|
||||
diags = diags.Append(tfdiags.Sourceless(
|
||||
tfdiags.Error,
|
||||
|
@ -178,6 +179,7 @@ func (n *EvalApply) Eval(ctx EvalContext) (interface{}, error) {
|
|||
),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
var newState *states.ResourceInstanceObject
|
||||
if !newVal.IsNull() { // null value indicates that the object is deleted, so we won't set a new state in that case
|
||||
|
|
Loading…
Reference in New Issue