(target, parent image.ID)
| 114 | } |
| 115 | |
| 116 | func (c cacheAdaptor) SetParent(target, parent image.ID) error { |
| 117 | ctx := context.TODO() |
| 118 | _, imgs, err := c.is.resolveAllReferences(ctx, target.String()) |
| 119 | if err != nil { |
| 120 | return fmt.Errorf("failed to list images with digest %q", target) |
| 121 | } |
| 122 | |
| 123 | var errs []error |
| 124 | is := c.is.images |
| 125 | for _, img := range imgs { |
| 126 | if img.Labels == nil { |
| 127 | img.Labels = make(map[string]string) |
| 128 | } |
| 129 | img.Labels[imageLabelClassicBuilderParent] = parent.String() |
| 130 | if _, err := is.Update(ctx, img, "labels."+imageLabelClassicBuilderParent); err != nil { |
| 131 | errs = append(errs, fmt.Errorf("failed to update parent label on image %v: %w", img, err)) |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | return multierror.Join(errs...) |
| 136 | } |
| 137 | |
| 138 | func (c cacheAdaptor) GetParent(target image.ID) (image.ID, error) { |
| 139 | ctx := context.TODO() |
nothing calls this directly
no test coverage detected