mirror of
https://github.com/anchore/syft.git
synced 2026-11-01 06:56:40 +01:00
bump stereoscope to include functional options (#823)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
@@ -90,7 +90,12 @@ func parseScheme(userInput string) string {
|
||||
func getImageWithRetryStrategy(userInput, location string, imageSource image.Source, registryOptions *image.RegistryOptions) (*image.Image, func(), error) {
|
||||
ctx := context.TODO()
|
||||
|
||||
img, err := stereoscope.GetImageFromSource(ctx, location, imageSource, registryOptions)
|
||||
var opts []stereoscope.Option
|
||||
if registryOptions != nil {
|
||||
opts = append(opts, stereoscope.WithRegistryOptions(*registryOptions))
|
||||
}
|
||||
|
||||
img, err := stereoscope.GetImageFromSource(ctx, location, imageSource, opts...)
|
||||
if err == nil {
|
||||
// Success on the first try!
|
||||
return img, stereoscope.Cleanup, nil
|
||||
@@ -120,7 +125,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(ctx, userInput, imageSource, registryOptions)
|
||||
img, err = stereoscope.GetImageFromSource(ctx, userInput, imageSource, opts...)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user