Skip to content

cri: fix using the labels to pin image#8867

Merged
estesp merged 1 commit intocontainerd:mainfrom
Iceber:pinned_image_label
Jul 27, 2023
Merged

cri: fix using the labels to pin image#8867
estesp merged 1 commit intocontainerd:mainfrom
Iceber:pinned_image_label

Conversation

@Iceber
Copy link
Copy Markdown
Member

@Iceber Iceber commented Jul 25, 2023

A image usually has multiple references, so as long as one of the references has io.cri-containerd.pinned=pinned label, then the image is pinned.

Reproducing current issues

$ ctr -n k8s.io images pull --label=io.cri-containerd.pinned=pinned docker.io/library/busybox:1.36
$ crictl --debug images
// ignore something
&Image{Id:sha256:a416a98b71e224a31ee99cff8e16063554498227d2b696152a9c3e0aa65e5824,RepoTags:[docker.io/library/busybox:1.36],RepoDigests:[],Size_:2224229,Uid:nil,Username:,Spec:nil,Pinned:false,}

Of course, if we ctr manually remove the image reference containing the label, Pinned will still be true, but will become false after restarting.

Although it would be possible to set Pinned strictly based on the labels of the image references, it would be complicated to keep track of each image reference, and I'm not sure it's necessary to do so.

@Iceber Iceber force-pushed the pinned_image_label branch from afeac0d to 7f7ba31 Compare July 26, 2023 04:26
@Iceber
Copy link
Copy Markdown
Member Author

Iceber commented Jul 26, 2023

/test pull-containerd-node-e2e

Copy link
Copy Markdown
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@estesp estesp merged commit 81895d2 into containerd:main Jul 27, 2023
@estesp estesp added cherry-pick/1.6.x cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch labels Jul 27, 2023
@estesp
Copy link
Copy Markdown
Member

estesp commented Jul 27, 2023

Sounds like a fix worth cherry picking into 1.6 LTS and 1.7 release branches

@samuelkarp samuelkarp added cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch and removed cherry-pick/1.6.x cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch labels Dec 1, 2023
Thompson1985

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants