copyFromDockerArchiveReaderReference copies the specified readerRef from reader.
(ctx context.Context, reader *dockerArchiveTransport.Reader, readerRef types.ImageReference, options *CopyOptions)
| 321 | |
| 322 | // copyFromDockerArchiveReaderReference copies the specified readerRef from reader. |
| 323 | func (r *Runtime) copyFromDockerArchiveReaderReference(ctx context.Context, reader *dockerArchiveTransport.Reader, readerRef types.ImageReference, options *CopyOptions) ([]string, error) { |
| 324 | c, err := r.newCopier(options) |
| 325 | if err != nil { |
| 326 | return nil, err |
| 327 | } |
| 328 | defer c.close() |
| 329 | |
| 330 | // Get a slice of storage references we can copy. |
| 331 | references, destNames, err := r.storageReferencesReferencesFromArchiveReader(ctx, readerRef, reader) |
| 332 | if err != nil { |
| 333 | return nil, err |
| 334 | } |
| 335 | |
| 336 | // Now copy all of the images. Use readerRef for performance. |
| 337 | for _, destRef := range references { |
| 338 | if _, err := c.copy(ctx, readerRef, destRef); err != nil { |
| 339 | return nil, err |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | return destNames, nil |
| 344 | } |
| 345 | |
| 346 | // copyFromRegistry pulls the specified, possibly unqualified, name from a |
| 347 | // registry. On successful pull it returns the ID of the image in local |
no test coverage detected