Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| ... | ... |
@@ -7,6 +7,7 @@ import ( |
| 7 | 7 |
containerdimages "github.com/containerd/containerd/images" |
| 8 | 8 |
"github.com/docker/docker/errdefs" |
| 9 | 9 |
"github.com/opencontainers/go-digest" |
| 10 |
+ ocispec "github.com/opencontainers/image-spec/specs-go/v1" |
|
| 10 | 11 |
"github.com/pkg/errors" |
| 11 | 12 |
) |
| 12 | 13 |
|
| ... | ... |
@@ -32,8 +33,8 @@ func (i *ImageService) softImageDelete(ctx context.Context, img containerdimages |
| 32 | 32 |
danglingImage := img |
| 33 | 33 |
|
| 34 | 34 |
danglingImage.Name = danglingImageName(img.Target.Digest) |
| 35 |
- delete(danglingImage.Labels, "io.containerd.image.name") |
|
| 36 |
- delete(danglingImage.Labels, "org.opencontainers.image.ref.name") |
|
| 35 |
+ delete(danglingImage.Labels, containerdimages.AnnotationImageName) |
|
| 36 |
+ delete(danglingImage.Labels, ocispec.AnnotationRefName) |
|
| 37 | 37 |
|
| 38 | 38 |
_, err = is.Create(context.Background(), danglingImage) |
| 39 | 39 |
|