MCPcopy Create free account
hub / github.com/conforma/cli / mustCreateFakeBundleImage

Function mustCreateFakeBundleImage

internal/tracker/tracker_test.go:531–553  ·  view source on GitHub ↗
(defs []fakeDefinition)

Source from the content-addressed store, hash-verified

529}
530
531func 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
555func mustCreateFakePipelineObject() runtime.Object {
556 gitCloneTask := pipeline.PipelineTask{

Callers 1

tracker_test.goFile · 0.85

Calls 1

LayerMethod · 0.65

Tested by

no test coverage detected