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/node_resource_abstract.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/node_resource_abstract.go')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/terraform/node_resource_abstract.go | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/vendor/github.com/hashicorp/terraform/terraform/node_resource_abstract.go b/vendor/github.com/hashicorp/terraform/terraform/node_resource_abstract.go index 3a0570c..d147b42 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/node_resource_abstract.go +++ b/vendor/github.com/hashicorp/terraform/terraform/node_resource_abstract.go | |||
@@ -187,6 +187,8 @@ func (n *NodeAbstractResource) References() []*addrs.Reference { | |||
187 | 187 | ||
188 | refs, _ := lang.ReferencesInExpr(c.Count) | 188 | refs, _ := lang.ReferencesInExpr(c.Count) |
189 | result = append(result, refs...) | 189 | result = append(result, refs...) |
190 | refs, _ = lang.ReferencesInExpr(c.ForEach) | ||
191 | result = append(result, refs...) | ||
190 | refs, _ = lang.ReferencesInBlock(c.Config, n.Schema) | 192 | refs, _ = lang.ReferencesInBlock(c.Config, n.Schema) |
191 | result = append(result, refs...) | 193 | result = append(result, refs...) |
192 | if c.Managed != nil { | 194 | if c.Managed != nil { |
@@ -238,21 +240,31 @@ func (n *NodeAbstractResourceInstance) References() []*addrs.Reference { | |||
238 | // need to do a little work here to massage this to the form we now | 240 | // need to do a little work here to massage this to the form we now |
239 | // want. | 241 | // want. |
240 | var result []*addrs.Reference | 242 | var result []*addrs.Reference |
241 | for _, addr := range s.Current.Dependencies { | ||
242 | if addr == nil { | ||
243 | // Should never happen; indicates a bug in the state loader | ||
244 | panic(fmt.Sprintf("dependencies for current object on %s contains nil address", n.ResourceInstanceAddr())) | ||
245 | } | ||
246 | 243 | ||
247 | // This is a little weird: we need to manufacture an addrs.Reference | 244 | // It is (apparently) possible for s.Current to be nil. This proved |
248 | // with a fake range here because the state isn't something we can | 245 | // difficult to reproduce, so we will fix the symptom here and hope |
249 | // make source references into. | 246 | // to find the root cause another time. |
250 | result = append(result, &addrs.Reference{ | 247 | // |
251 | Subject: addr, | 248 | // https://github.com/hashicorp/terraform/issues/21407 |
252 | SourceRange: tfdiags.SourceRange{ | 249 | if s.Current == nil { |
253 | Filename: "(state file)", | 250 | log.Printf("[WARN] no current state found for %s", n.Name()) |
254 | }, | 251 | } else { |
255 | }) | 252 | for _, addr := range s.Current.Dependencies { |
253 | if addr == nil { | ||
254 | // Should never happen; indicates a bug in the state loader | ||
255 | panic(fmt.Sprintf("dependencies for current object on %s contains nil address", n.ResourceInstanceAddr())) | ||
256 | } | ||
257 | |||
258 | // This is a little weird: we need to manufacture an addrs.Reference | ||
259 | // with a fake range here because the state isn't something we can | ||
260 | // make source references into. | ||
261 | result = append(result, &addrs.Reference{ | ||
262 | Subject: addr, | ||
263 | SourceRange: tfdiags.SourceRange{ | ||
264 | Filename: "(state file)", | ||
265 | }, | ||
266 | }) | ||
267 | } | ||
256 | } | 268 | } |
257 | return result | 269 | return result |
258 | } | 270 | } |