Skip to content

Commit 2bcd6a4

Browse files
committed
cri: patch update image labels
The CRI-plugin subscribes the image event on k8s.io namespace. By default, the image event is created by CRI-API. However, the image can be downloaded by containerd API on k8s.io with the customized labels. The CRI-plugin should use patch update for `io.cri-containerd.image` label in this case. Fixes: #5900 Signed-off-by: Wei Fu <[email protected]>
1 parent 61a46e9 commit 2bcd6a4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/cri/server/image_pull.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ func (c *criService) createImageReference(ctx context.Context, name string, desc
233233
if oldImg.Target.Digest == img.Target.Digest && oldImg.Labels[imageLabelKey] == imageLabelValue {
234234
return nil
235235
}
236-
_, err = c.client.ImageService().Update(ctx, img, "target", "labels")
236+
_, err = c.client.ImageService().Update(ctx, img, "target", "labels."+imageLabelKey)
237237
return err
238238
}
239239

0 commit comments

Comments
 (0)