Merge pull request #39068 from NickrenREN/imageManager-start

Automatic merge from submit-queue (batch tested with PRs 39076, 39068)

fix image manager Start() function return
pull/6/head
Kubernetes Submit Queue 2016-12-22 00:27:30 -08:00 committed by GitHub
commit ab91500f15
2 changed files with 3 additions and 6 deletions

View File

@ -44,7 +44,7 @@ type ImageGCManager interface {
GarbageCollect() error GarbageCollect() error
// Start async garbage collection of images. // Start async garbage collection of images.
Start() error Start()
GetImageList() ([]kubecontainer.Image, error) GetImageList() ([]kubecontainer.Image, error)
@ -152,7 +152,7 @@ func NewImageGCManager(runtime container.Runtime, cadvisorInterface cadvisor.Int
return im, nil return im, nil
} }
func (im *realImageGCManager) Start() error { func (im *realImageGCManager) Start() {
go wait.Until(func() { go wait.Until(func() {
// Initial detection make detected time "unknown" in the past. // Initial detection make detected time "unknown" in the past.
var ts time.Time var ts time.Time
@ -178,7 +178,6 @@ func (im *realImageGCManager) Start() error {
} }
}, 30*time.Second, wait.NeverStop) }, 30*time.Second, wait.NeverStop)
return nil
} }
// Get a list of images on this node // Get a list of images on this node

View File

@ -1178,9 +1178,7 @@ func (kl *Kubelet) initializeModules() error {
} }
// Step 4: Start the image manager. // Step 4: Start the image manager.
if err := kl.imageManager.Start(); err != nil { kl.imageManager.Start()
return fmt.Errorf("Failed to start ImageManager, images may not be garbage collected: %v", err)
}
// Step 5: Start container manager. // Step 5: Start container manager.
node, err := kl.getNodeAnyWay() node, err := kl.getNodeAnyWay()