diff --git a/.github/actions/bootstrap/action.yaml b/.github/actions/bootstrap/action.yaml index 71054830..37aa49b3 100644 --- a/.github/actions/bootstrap/action.yaml +++ b/.github/actions/bootstrap/action.yaml @@ -4,7 +4,7 @@ inputs: go-version: description: "Go version to install" required: true - default: "1.20.x" + default: "1.21.x" use-go-cache: description: "Restore go cache" required: true diff --git a/client.go b/client.go index 43c6335a..abbdd4f4 100644 --- a/client.go +++ b/client.go @@ -67,11 +67,18 @@ func WithPlatform(platform string) Option { // GetImage parses the user provided image string and provides an image object; // note: the source where the image should be referenced from is automatically inferred. func GetImage(ctx context.Context, imgStr string, options ...Option) (*image.Image, error) { - return GetImageFromSource(ctx, imgStr, "", options...) + return getImageFromSource(ctx, imgStr, "", options...) } // GetImageFromSource returns an image from the explicitly provided source. func GetImageFromSource(ctx context.Context, imgStr string, source image.Source, options ...Option) (*image.Image, error) { + if source == "" { + return nil, fmt.Errorf("source not provided, please specify a valid source tag") + } + return getImageFromSource(ctx, imgStr, source, options...) +} + +func getImageFromSource(ctx context.Context, imgStr string, source image.Source, options ...Option) (*image.Image, error) { log.Debugf("image: source=%+v location=%+v", source, imgStr) // apply ImageProviderConfig config