]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blobdiff - vendor/github.com/hashicorp/terraform/plans/objchange/compatible.go
update vendor and go.mod
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / hashicorp / terraform / plans / objchange / compatible.go
index 8b7ef43fddfa0d27120cae228b7ba6cd0dd8de70..d85086c97c184282c5b7ba79fdbcc480b853107f 100644 (file)
@@ -84,7 +84,7 @@ func assertObjectCompatible(schema *configschema.Block, planned, actual cty.Valu
                        // whether there are dynamically-typed attributes inside. However,
                        // both support a similar-enough API that we can treat them the
                        // same for our purposes here.
-                       if !plannedV.IsKnown() || plannedV.IsNull() || actualV.IsNull() {
+                       if !plannedV.IsKnown() || !actualV.IsKnown() || plannedV.IsNull() || actualV.IsNull() {
                                continue
                        }
 
@@ -169,6 +169,16 @@ func assertObjectCompatible(schema *configschema.Block, planned, actual cty.Valu
                        })
                        errs = append(errs, setErrs...)
 
+                       if maybeUnknownBlocks {
+                               // When unknown blocks are present the final number of blocks
+                               // may be different, either because the unknown set values
+                               // become equal and are collapsed, or the count is unknown due
+                               // a dynamic block. Unfortunately this means we can't do our
+                               // usual checks in this case without generating false
+                               // negatives.
+                               continue
+                       }
+
                        // There can be fewer elements in a set after its elements are all
                        // known (values that turn out to be equal will coalesce) but the
                        // number of elements must never get larger.