Compare before and after paths completely
This commit is contained in:
parent
2c352ef182
commit
a927e88c06
|
@ -3,6 +3,7 @@ package terraform
|
|||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
multierror "github.com/hashicorp/go-multierror"
|
||||
|
@ -118,7 +119,7 @@ func (n *EvalApply) Eval(ctx EvalContext) (interface{}, error) {
|
|||
// and we should not communicate with the provider or perform further action.
|
||||
eqV := unmarkedBefore.Equals(unmarkedAfter)
|
||||
eq := eqV.IsKnown() && eqV.True()
|
||||
if change.Action == plans.Update && eq && (len(beforePaths) != len(afterPaths)) {
|
||||
if change.Action == plans.Update && eq && !reflect.DeepEqual(beforePaths, afterPaths) {
|
||||
return nil, diags.ErrWithWarnings()
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package terraform
|
|||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/hcl/v2"
|
||||
|
@ -484,7 +485,7 @@ func (n *EvalDiff) Eval(ctx EvalContext) (interface{}, error) {
|
|||
|
||||
// If we plan to write or delete sensitive paths from state,
|
||||
// this is an Update action
|
||||
if action == plans.NoOp && len(priorPaths) != len(unmarkedPaths) {
|
||||
if action == plans.NoOp && !reflect.DeepEqual(priorPaths, unmarkedPaths) {
|
||||
action = plans.Update
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue