terraform: don't crash if validating orphan
This commit is contained in:
parent
bbdb375612
commit
6e7d23d612
|
@ -1053,6 +1053,7 @@ func (c *walkContext) validateWalkFn() depgraph.WalkFunc {
|
||||||
|
|
||||||
// If the resouce name doesn't match the name regular
|
// If the resouce name doesn't match the name regular
|
||||||
// expression, show a warning.
|
// expression, show a warning.
|
||||||
|
if rn.Config != nil {
|
||||||
if !config.NameRegexp.Match([]byte(rn.Config.Name)) {
|
if !config.NameRegexp.Match([]byte(rn.Config.Name)) {
|
||||||
l.Lock()
|
l.Lock()
|
||||||
meta.Warns = append(meta.Warns, fmt.Sprintf(
|
meta.Warns = append(meta.Warns, fmt.Sprintf(
|
||||||
|
@ -1062,6 +1063,7 @@ func (c *walkContext) validateWalkFn() depgraph.WalkFunc {
|
||||||
rn.Resource.Id))
|
rn.Resource.Id))
|
||||||
l.Unlock()
|
l.Unlock()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.Printf("[INFO] Validating resource: %s", rn.Resource.Id)
|
log.Printf("[INFO] Validating resource: %s", rn.Resource.Id)
|
||||||
ws, es := rn.Resource.Provider.ValidateResource(
|
ws, es := rn.Resource.Provider.ValidateResource(
|
||||||
|
|
Loading…
Reference in New Issue