-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass Pinned field to kubecontainer.Image #119986
Conversation
/sig node |
/cc @pacoxu @endocrimes |
@@ -111,6 +111,7 @@ func (m *kubeGenericRuntimeManager) ListImages(ctx context.Context) ([]kubeconta | |||
RepoTags: img.RepoTags, | |||
RepoDigests: img.RepoDigests, | |||
Spec: toKubeContainerImageSpec(img), | |||
Pinned: img.Pinned, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a unit test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Signed-off-by: ruiwen-zhao <ruiwen@google.com>
2fd193a
to
5bbc4f7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
/retest |
/triage accepted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
wow. How did we miss it =(
LGTM label has been added. Git tree hash: ce1990e43b1b9982817d870072d4df115cbed23f
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mrunalp, ruiwen-zhao, samuelkarp, SergeyKanzhelev The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
/release-note "Fixes the bug when images pinned by the container runtime can be garbage collected by kubelet" |
/release-note-edit |
/release-note-edit
|
…#119986-upstream-release-1.28 Automated cherry pick of #119986: Pass Pinned field to kubecontainer.Image
…#119986-upstream-release-1.26 Automated cherry pick of #119986: Pass Pinned field to kubecontainer.Image
…#119986-upstream-release-1.25 Automated cherry pick of #119986: Pass Pinned field to kubecontainer.Image
…#119986-upstream-release-1.27 Automated cherry pick of #119986: Pass Pinned field to kubecontainer.Image
What type of PR is this?
/kind bug
What this PR does / why we need it:
#103299 added support for preventing GC on pinned images. However, it didn't pass the
Pinned
field from runtime's response tokubecontainer.Image
. So when image_gc_manager callskubernetes/pkg/kubelet/images/image_gc_manager.go
Line 232 in 210a97e
It will always get
Pinned: false
.After this PR, with containerd 1.7.3, I verified that image gc manager can see images as pinned:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
I will backport this to change to previous minor versions once this PR is approved.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: