Refactor and improve base URL prep for client

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
This commit is contained in:
Dan Luhring
2021-02-02 09:54:00 -05:00
parent b207bc8ee2
commit babb09b3a4
4 changed files with 196 additions and 63 deletions
+2 -2
View File
@@ -159,12 +159,12 @@ func doImport(src source.Source, s source.Metadata, catalog *pkg.Catalog, d *dis
}
c, err := anchore.NewClient(anchore.Configuration{
BasePath: appConfig.Anchore.Host,
BaseURL: appConfig.Anchore.Host,
Username: appConfig.Anchore.Username,
Password: appConfig.Anchore.Password,
})
if err != nil {
return fmt.Errorf("failed to create anchore client: %+v", err)
return fmt.Errorf("unable to upload results: %w", err)
}
importCfg := anchore.ImportConfig{