| 529 | } |
| 530 | |
| 531 | func mustCreateFakeBundleImage(defs []fakeDefinition) v1.Image { |
| 532 | adds := make([]mutate.Addendum, 0, len(defs)) |
| 533 | |
| 534 | for _, definition := range defs { |
| 535 | l, err := random.Layer(0, types.DockerLayer) |
| 536 | if err != nil { |
| 537 | panic("unable to create layer for test data") |
| 538 | } |
| 539 | adds = append(adds, mutate.Addendum{ |
| 540 | Layer: l, |
| 541 | Annotations: map[string]string{ |
| 542 | oci.KindAnnotation: definition.kind, |
| 543 | oci.TitleAnnotation: definition.name, |
| 544 | }, |
| 545 | }) |
| 546 | } |
| 547 | |
| 548 | img, err := mutate.Append(empty.Image, adds...) |
| 549 | if err != nil { |
| 550 | panic(err) |
| 551 | } |
| 552 | return img |
| 553 | } |
| 554 | |
| 555 | func mustCreateFakePipelineObject() runtime.Object { |
| 556 | gitCloneTask := pipeline.PipelineTask{ |