mirror of
https://github.com/anchore/syft.git
synced 2026-11-01 15:06:36 +01:00
Ensure completion of UI progress bar (#810)
* update stereoscope fetches latest fixes for UI Signed-off-by: Jonas Galvão Xavier <jonas.agx@gmail.com> * use context when getting image Signed-off-by: Jonas Galvão Xavier <jonas.agx@gmail.com>
This commit is contained in:
@@ -6,6 +6,7 @@ within this package.
|
||||
package source
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
@@ -87,7 +88,9 @@ func parseScheme(userInput string) string {
|
||||
}
|
||||
|
||||
func getImageWithRetryStrategy(userInput, location string, imageSource image.Source, registryOptions *image.RegistryOptions) (*image.Image, func(), error) {
|
||||
img, err := stereoscope.GetImageFromSource(location, imageSource, registryOptions)
|
||||
ctx := context.TODO()
|
||||
|
||||
img, err := stereoscope.GetImageFromSource(ctx, location, imageSource, registryOptions)
|
||||
if err == nil {
|
||||
// Success on the first try!
|
||||
return img, stereoscope.Cleanup, nil
|
||||
@@ -117,7 +120,7 @@ func getImageWithRetryStrategy(userInput, location string, imageSource image.Sou
|
||||
// We need to determine the image source again, such that this determination
|
||||
// doesn't take scheme parsing into account.
|
||||
imageSource = image.DetermineImagePullSource(userInput)
|
||||
img, err = stereoscope.GetImageFromSource(userInput, imageSource, registryOptions)
|
||||
img, err = stereoscope.GetImageFromSource(ctx, userInput, imageSource, registryOptions)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user