diff options
author | Alexandre Garand <alexandre.garand@fretlink.com> | 2019-08-09 15:59:15 +0200 |
---|---|---|
committer | Alexandre Garand <alexandre.garand@fretlink.com> | 2019-08-09 16:39:21 +0200 |
commit | 863486a6b71ed0e562a3965bed56465d007b1418 (patch) | |
tree | e93f6a687695af86d54237ec9f575d4ef104222d /vendor/github.com/hashicorp/terraform/terraform/eval_diff.go | |
parent | 49c1c7b4dc69ffb9ab52330e6dc52ccdd6351087 (diff) | |
download | terraform-provider-statuscake-863486a6b71ed0e562a3965bed56465d007b1418.tar.gz terraform-provider-statuscake-863486a6b71ed0e562a3965bed56465d007b1418.tar.zst terraform-provider-statuscake-863486a6b71ed0e562a3965bed56465d007b1418.zip |
update vendor and go.modadd_contact_groups
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/terraform/eval_diff.go')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/terraform/eval_diff.go | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/vendor/github.com/hashicorp/terraform/terraform/eval_diff.go b/vendor/github.com/hashicorp/terraform/terraform/eval_diff.go index b7acfb0..695b5fe 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/eval_diff.go +++ b/vendor/github.com/hashicorp/terraform/terraform/eval_diff.go | |||
@@ -4,7 +4,6 @@ import ( | |||
4 | "bytes" | 4 | "bytes" |
5 | "fmt" | 5 | "fmt" |
6 | "log" | 6 | "log" |
7 | "reflect" | ||
8 | "strings" | 7 | "strings" |
9 | 8 | ||
10 | "github.com/hashicorp/hcl2/hcl" | 9 | "github.com/hashicorp/hcl2/hcl" |
@@ -134,7 +133,8 @@ func (n *EvalDiff) Eval(ctx EvalContext) (interface{}, error) { | |||
134 | // Should be caught during validation, so we don't bother with a pretty error here | 133 | // Should be caught during validation, so we don't bother with a pretty error here |
135 | return nil, fmt.Errorf("provider does not support resource type %q", n.Addr.Resource.Type) | 134 | return nil, fmt.Errorf("provider does not support resource type %q", n.Addr.Resource.Type) |
136 | } | 135 | } |
137 | keyData := EvalDataForInstanceKey(n.Addr.Key) | 136 | forEach, _ := evaluateResourceForEachExpression(n.Config.ForEach, ctx) |
137 | keyData := EvalDataForInstanceKey(n.Addr.Key, forEach) | ||
138 | configVal, _, configDiags := ctx.EvaluateBlock(config.Config, schema, nil, keyData) | 138 | configVal, _, configDiags := ctx.EvaluateBlock(config.Config, schema, nil, keyData) |
139 | diags = diags.Append(configDiags) | 139 | diags = diags.Append(configDiags) |
140 | if configDiags.HasErrors() { | 140 | if configDiags.HasErrors() { |
@@ -174,6 +174,20 @@ func (n *EvalDiff) Eval(ctx EvalContext) (interface{}, error) { | |||
174 | } | 174 | } |
175 | } | 175 | } |
176 | 176 | ||
177 | log.Printf("[TRACE] Re-validating config for %q", n.Addr.Absolute(ctx.Path())) | ||
178 | // Allow the provider to validate the final set of values. | ||
179 | // The config was statically validated early on, but there may have been | ||
180 | // unknown values which the provider could not validate at the time. | ||
181 | validateResp := provider.ValidateResourceTypeConfig( | ||
182 | providers.ValidateResourceTypeConfigRequest{ | ||
183 | TypeName: n.Addr.Resource.Type, | ||
184 | Config: configVal, | ||
185 | }, | ||
186 | ) | ||
187 | if validateResp.Diagnostics.HasErrors() { | ||
188 | return nil, validateResp.Diagnostics.InConfigBody(config.Config).Err() | ||
189 | } | ||
190 | |||
177 | // The provider gets an opportunity to customize the proposed new value, | 191 | // The provider gets an opportunity to customize the proposed new value, |
178 | // which in turn produces the _planned_ new value. | 192 | // which in turn produces the _planned_ new value. |
179 | resp := provider.PlanResourceChange(providers.PlanResourceChangeRequest{ | 193 | resp := provider.PlanResourceChange(providers.PlanResourceChangeRequest{ |
@@ -448,8 +462,9 @@ func (n *EvalDiff) Eval(ctx EvalContext) (interface{}, error) { | |||
448 | // must _also_ record the returned change in the active plan, | 462 | // must _also_ record the returned change in the active plan, |
449 | // which the expression evaluator will use in preference to this | 463 | // which the expression evaluator will use in preference to this |
450 | // incomplete value recorded in the state. | 464 | // incomplete value recorded in the state. |
451 | Status: states.ObjectPlanned, | 465 | Status: states.ObjectPlanned, |
452 | Value: plannedNewVal, | 466 | Value: plannedNewVal, |
467 | Private: plannedPrivate, | ||
453 | } | 468 | } |
454 | } | 469 | } |
455 | 470 | ||
@@ -517,7 +532,7 @@ func processIgnoreChangesIndividual(prior, proposed cty.Value, ignoreChanges []h | |||
517 | // away any deeper values we already produced at that point. | 532 | // away any deeper values we already produced at that point. |
518 | var ignoreTraversal hcl.Traversal | 533 | var ignoreTraversal hcl.Traversal |
519 | for i, candidate := range ignoreChangesPath { | 534 | for i, candidate := range ignoreChangesPath { |
520 | if reflect.DeepEqual(path, candidate) { | 535 | if path.Equals(candidate) { |
521 | ignoreTraversal = ignoreChanges[i] | 536 | ignoreTraversal = ignoreChanges[i] |
522 | } | 537 | } |
523 | } | 538 | } |
@@ -790,6 +805,7 @@ func (n *EvalDiffDestroy) Eval(ctx EvalContext) (interface{}, error) { | |||
790 | Before: state.Value, | 805 | Before: state.Value, |
791 | After: cty.NullVal(cty.DynamicPseudoType), | 806 | After: cty.NullVal(cty.DynamicPseudoType), |
792 | }, | 807 | }, |
808 | Private: state.Private, | ||
793 | ProviderAddr: n.ProviderAddr, | 809 | ProviderAddr: n.ProviderAddr, |
794 | } | 810 | } |
795 | 811 | ||