mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
cli: include search paths for image info json in error message printed to user (#963)
This commit is contained in:
parent
8cfa402c9a
commit
7bf7286242
@ -54,11 +54,22 @@ func (f *Fetcher) FetchReference(ctx context.Context, config *config.Config) (st
|
||||
Version: ver.Version,
|
||||
}
|
||||
|
||||
url, err := imgInfoReq.URL()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
imgInfo, err := getFromFile(f.fs, imgInfoReq)
|
||||
if err != nil && errors.Is(err, fs.ErrNotExist) {
|
||||
imgInfo, err = f.fetcher.FetchImageInfo(ctx, imgInfoReq)
|
||||
}
|
||||
if err != nil {
|
||||
|
||||
var notFoundErr *fetcher.NotFoundError
|
||||
switch {
|
||||
case errors.As(err, ¬FoundErr):
|
||||
overridePath := imageInfoFilename(imgInfoReq)
|
||||
return "", fmt.Errorf("image info file not found locally at %q or remotely at %s", overridePath, url)
|
||||
case err != nil:
|
||||
return "", err
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user