(ctx context.Context, parsedReference *referenceutil.ImageReference, options types.ImagePullOptions)
| 40 | ) |
| 41 | |
| 42 | func prepareImageStore(ctx context.Context, parsedReference *referenceutil.ImageReference, options types.ImagePullOptions) (*transferimage.Store, error) { |
| 43 | var storeOpts []transferimage.StoreOpt |
| 44 | if len(options.OCISpecPlatform) > 0 { |
| 45 | storeOpts = append(storeOpts, transferimage.WithPlatforms(options.OCISpecPlatform...)) |
| 46 | } |
| 47 | |
| 48 | unpackEnabled := len(options.OCISpecPlatform) == 1 |
| 49 | if options.Unpack != nil { |
| 50 | unpackEnabled = *options.Unpack |
| 51 | if unpackEnabled && len(options.OCISpecPlatform) != 1 { |
| 52 | return nil, fmt.Errorf("unpacking requires a single platform to be specified (e.g., --platform=amd64)") |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | if unpackEnabled { |
| 57 | platform := options.OCISpecPlatform[0] |
| 58 | snapshotter := options.GOptions.Snapshotter |
| 59 | storeOpts = append(storeOpts, transferimage.WithUnpack(platform, snapshotter)) |
| 60 | } |
| 61 | |
| 62 | return transferimage.NewStore(parsedReference.String(), storeOpts...), nil |
| 63 | } |
| 64 | |
| 65 | func createOCIRegistry(ctx context.Context, parsedReference *referenceutil.ImageReference, gOptions types.GlobalCommandOptions, plainHTTP bool) (*registry.OCIRegistry, func(), error) { |
| 66 | ch, err := dockerconfigresolver.NewCredentialHelper(parsedReference.Domain) |
no test coverage detected
searching dependent graphs…