helper/schema: Guard against a panic if Timeout is not properly
structured
This commit is contained in:
parent
b58709aa91
commit
aa3677cd89
|
@ -61,7 +61,7 @@ func (t *ResourceTimeout) ConfigDecode(s *Resource, c *terraform.ResourceConfig)
|
||||||
}
|
}
|
||||||
|
|
||||||
if raw, ok := c.Config["timeout"]; ok {
|
if raw, ok := c.Config["timeout"]; ok {
|
||||||
configTimeouts := raw.([]map[string]interface{})
|
if configTimeouts, ok := raw.([]map[string]interface{}); ok {
|
||||||
for _, timeoutValues := range configTimeouts {
|
for _, timeoutValues := range configTimeouts {
|
||||||
// loop through each Timeout given in the configuration and validate they
|
// loop through each Timeout given in the configuration and validate they
|
||||||
// the Timeout defined in the resource
|
// the Timeout defined in the resource
|
||||||
|
@ -108,6 +108,9 @@ func (t *ResourceTimeout) ConfigDecode(s *Resource, c *terraform.ResourceConfig)
|
||||||
*timeout = rt
|
*timeout = rt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
log.Printf("[WARN] Invalid Timeout structure found, skipping timeouts")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue