File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -747,13 +747,6 @@ func (e *edged) initializeModules() error {
747747}
748748
749749func (e * edged ) StartGarbageCollection () {
750- go utilwait .Until (func () {
751- err := e .imageGCManager .GarbageCollect ()
752- if err != nil {
753- klog .Errorf ("Image garbage collection failed: %v" , err )
754- }
755- }, ImageGCPeriod , utilwait .NeverStop )
756-
757750 go utilwait .Until (func () {
758751 if e .isInitPodReady () {
759752 err := e .containerGCManager .GarbageCollect ()
@@ -762,6 +755,18 @@ func (e *edged) StartGarbageCollection() {
762755 }
763756 }
764757 }, ContainerGCPeriod , utilwait .NeverStop )
758+
759+ if edgedconfig .Config .ImageGCHighThreshold == 100 {
760+ klog .Infof ("ImageGCHighThreshold is set 100, Disable image GC" )
761+ return
762+ }
763+
764+ go utilwait .Until (func () {
765+ err := e .imageGCManager .GarbageCollect ()
766+ if err != nil {
767+ klog .Errorf ("Image garbage collection failed: %v" , err )
768+ }
769+ }, ImageGCPeriod , utilwait .NeverStop )
765770}
766771
767772func (e * edged ) syncLoopIteration (plegCh <- chan * pleg.PodLifecycleEvent , housekeepingCh <- chan time.Time , syncWorkQueueCh <- chan time.Time ) {
You can’t perform that action at this time.
0 commit comments