mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
Merge pull request #66051 from jiaxuanzhou/imageGC
Automatic merge from submit-queue (batch tested with PRs 66051, 66049). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Fix:Image garbage collection is always disabled in kubelet in 1.11 **What this PR does / why we need it**: **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes #66046 **Special notes for your reviewer**: @yujuhong @derekwaynecarr **Release note**: ```release-note NONE ```
This commit is contained in:
commit
6c6449c37b
@ -1238,12 +1238,10 @@ func (kl *Kubelet) StartGarbageCollection() {
|
||||
}
|
||||
}, ContainerGCPeriod, wait.NeverStop)
|
||||
|
||||
stopChan := make(chan struct{})
|
||||
defer close(stopChan)
|
||||
// when the high threshold is set to 100, stub the image GC manager
|
||||
if kl.kubeletConfiguration.ImageGCHighThresholdPercent == 100 {
|
||||
glog.V(2).Infof("ImageGCHighThresholdPercent is set 100, Disable image GC")
|
||||
go func() { stopChan <- struct{}{} }()
|
||||
return
|
||||
}
|
||||
|
||||
prevImageGCFailed := false
|
||||
@ -1266,7 +1264,7 @@ func (kl *Kubelet) StartGarbageCollection() {
|
||||
|
||||
glog.V(vLevel).Infof("Image garbage collection succeeded")
|
||||
}
|
||||
}, ImageGCPeriod, stopChan)
|
||||
}, ImageGCPeriod, wait.NeverStop)
|
||||
}
|
||||
|
||||
// initializeModules will initialize internal modules that do not require the container runtime to be up.
|
||||
|
Loading…
Reference in New Issue
Block a user