(t *testing.T, ref types.ImageReference, cache types.BlobInfoCache, layers []testBlob, config *testBlob)
| 348 | } |
| 349 | |
| 350 | func createUncommittedImageDest(t *testing.T, ref types.ImageReference, cache types.BlobInfoCache, |
| 351 | layers []testBlob, config *testBlob) (types.ImageDestination, types.UnparsedImage) { |
| 352 | dest, err := ref.NewImageDestination(context.Background(), nil) |
| 353 | require.NoError(t, err) |
| 354 | |
| 355 | layerDescriptors := []manifest.Schema2Descriptor{} |
| 356 | for _, layer := range layers { |
| 357 | desc := layer.storeBlob(t, dest, cache, manifest.DockerV2Schema2LayerMediaType, false) |
| 358 | layerDescriptors = append(layerDescriptors, desc) |
| 359 | } |
| 360 | |
| 361 | if config == nil { |
| 362 | cd := configForLayers(t, layers) |
| 363 | config = &cd |
| 364 | } |
| 365 | configDescriptor := config.storeBlob(t, dest, cache, manifest.DockerV2Schema2ConfigMediaType, true) |
| 366 | |
| 367 | manifest := manifest.Schema2FromComponents(configDescriptor, layerDescriptors) |
| 368 | manifestBytes, err := manifest.Serialize() |
| 369 | require.NoError(t, err) |
| 370 | err = dest.PutManifest(context.Background(), manifestBytes, nil) |
| 371 | require.NoError(t, err) |
| 372 | unparsedToplevel := unparsedImage{ |
| 373 | imageReference: nil, |
| 374 | manifestBytes: manifestBytes, |
| 375 | manifestType: manifest.MediaType, |
| 376 | signatures: nil, |
| 377 | } |
| 378 | return dest, &unparsedToplevel |
| 379 | } |
| 380 | |
| 381 | func createImage(t *testing.T, ref types.ImageReference, cache types.BlobInfoCache, |
| 382 | layers []testBlob, config *testBlob) { |
no test coverage detected
searching dependent graphs…