working commit
This commit is contained in:
@@ -18,26 +18,26 @@ const (
|
||||
MediaTypeOIMv1 = "application/vnd.oci.image.manifest.v1+json"
|
||||
)
|
||||
|
||||
type Downloader struct {
|
||||
type Loader struct {
|
||||
cli *Client
|
||||
}
|
||||
|
||||
func NewDownloader(client *Client) *Downloader {
|
||||
return &Downloader{
|
||||
func NewLoader(client *Client) *Loader {
|
||||
return &Loader{
|
||||
cli: client,
|
||||
}
|
||||
}
|
||||
|
||||
func (down *Downloader) Pull(ctx context.Context, rawref, dir, osname, arch string) error {
|
||||
func (down *Loader) Pull(ctx context.Context, rawref, dir, osname, arch string) error {
|
||||
var err error
|
||||
ref, err := ParseReference(rawref)
|
||||
ref, err := NewReferer(rawref)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
rawrepo := ref.Repo()
|
||||
rawrepo := ref.RawRepo()
|
||||
tag := ref.Tag()
|
||||
|
||||
exist, mime, man, err := down.cli.GetManifest(ctx, rawrepo, tag)
|
||||
exist, mime, man, err := down.cli.GetRawManifest(ctx, ref.Raw())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -64,8 +64,12 @@ func (down *Downloader) Pull(ctx context.Context, rawref, dir, osname, arch stri
|
||||
}
|
||||
}
|
||||
}
|
||||
if digstr == "" {
|
||||
err = errors.New("Manifest for required arch and OS not found")
|
||||
return err
|
||||
}
|
||||
fmt.Printf("Tag: %s\n", tag)
|
||||
exist, mime, man, err = down.cli.GetManifest(ctx, rawrepo, tag)
|
||||
exist, mime, man, err = down.cli.GetRawManifest(ctx, ref.RawWithTag(digstr))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user