Skip to content

Commit

Permalink
Avoid ignoring schema for uninitialized module
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko committed Nov 16, 2020
1 parent fda7bdf commit 3afb4ff
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/terraform/rootmodule/root_module_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,13 @@ func (rmm *rootModuleManager) SchemaForPath(path string) (*schema.BodySchema, er
return schema, nil
}
}
return nil, fmt.Errorf("failed to find schema for %s", path)

rm, err := rmm.RootModuleByPath(path)
if err != nil {
return nil, err
}

return rm.MergedSchema()
}

func (rmm *rootModuleManager) rootModuleByPath(dir string) (*rootModule, bool) {
Expand Down

0 comments on commit 3afb4ff

Please sign in to comment.