Merge pull request #17025 from hashicorp/jbardin/module-errors
use the full module name with host for errors
This commit is contained in:
commit
3d9c9e5e28
|
@ -295,17 +295,17 @@ func (s Storage) findRegistryModule(mSource, constraint string) (moduleRecord, e
|
||||||
}
|
}
|
||||||
rec.registry = true
|
rec.registry = true
|
||||||
|
|
||||||
log.Printf("[TRACE] %q is a registry module", mod.Module())
|
log.Printf("[TRACE] %q is a registry module", mod.Display())
|
||||||
|
|
||||||
versions, err := s.moduleVersions(mod.String())
|
versions, err := s.moduleVersions(mod.String())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("[ERROR] error looking up versions for %q: %s", mod.Module(), err)
|
log.Printf("[ERROR] error looking up versions for %q: %s", mod.Display(), err)
|
||||||
return rec, err
|
return rec, err
|
||||||
}
|
}
|
||||||
|
|
||||||
match, err := newestRecord(versions, constraint)
|
match, err := newestRecord(versions, constraint)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("[INFO] no matching version for %q<%s>, %s", mod.Module(), constraint, err)
|
log.Printf("[INFO] no matching version for %q<%s>, %s", mod.Display(), constraint, err)
|
||||||
}
|
}
|
||||||
log.Printf("[DEBUG] matched %q version %s for %s", mod, match.Version, constraint)
|
log.Printf("[DEBUG] matched %q version %s for %s", mod, match.Version, constraint)
|
||||||
|
|
||||||
|
@ -322,7 +322,7 @@ func (s Storage) findRegistryModule(mSource, constraint string) (moduleRecord, e
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(resp.Modules) == 0 {
|
if len(resp.Modules) == 0 {
|
||||||
return rec, fmt.Errorf("module %q not found in registry", mod.Module())
|
return rec, fmt.Errorf("module %q not found in registry", mod.Display())
|
||||||
}
|
}
|
||||||
|
|
||||||
match, err := newestVersion(resp.Modules[0].Versions, constraint)
|
match, err := newestVersion(resp.Modules[0].Versions, constraint)
|
||||||
|
@ -331,7 +331,7 @@ func (s Storage) findRegistryModule(mSource, constraint string) (moduleRecord, e
|
||||||
}
|
}
|
||||||
|
|
||||||
if match == nil {
|
if match == nil {
|
||||||
return rec, fmt.Errorf("no versions for %q found matching %q", mod.Module(), constraint)
|
return rec, fmt.Errorf("no versions for %q found matching %q", mod.Display(), constraint)
|
||||||
}
|
}
|
||||||
|
|
||||||
rec.Version = match.Version
|
rec.Version = match.Version
|
||||||
|
|
Loading…
Reference in New Issue