Skip to content

Commit

Permalink
fix: always use the local module if available (#2211)
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas authored Jul 31, 2024
1 parent cf5d19b commit d6b6e17
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions buildengine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,11 @@ func (e *Engine) buildGraph(moduleName string, out map[string][]string) error {
foundModule = true
deps = meta.module.Dependencies
}
if sch, ok := e.controllerSchema.Load(moduleName); ok {
foundModule = true
deps = append(deps, sch.Imports()...)
if !foundModule {
if sch, ok := e.controllerSchema.Load(moduleName); ok {
foundModule = true
deps = append(deps, sch.Imports()...)
}
}
if !foundModule {
return fmt.Errorf("module %q not found", moduleName)
Expand Down Expand Up @@ -731,6 +733,9 @@ func (e *Engine) gatherSchemas(
e.moduleMetas.Range(func(name string, meta moduleMeta) bool {
if _, ok := moduleSchemas[name]; ok {
out[name] = moduleSchemas[name]
} else {
// We don't want to use a remote schema if we have it locally
delete(out, name)
}
return true
})
Expand Down

0 comments on commit d6b6e17

Please sign in to comment.