Skip to content

Commit

Permalink
Merge pull request #15099 from smarterclayton/deleted_imagestreams
Browse files Browse the repository at this point in the history
Deleted image streams are never removed from controller queue
  • Loading branch information
smarterclayton authored Jul 7, 2017
2 parents 2d61a5b + 0d0c686 commit e183ec5
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions pkg/image/controller/imagestream_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,24 @@ func (c *ImageStreamController) processNextWorkItem() bool {
defer c.queue.Done(key)

stream, err := c.getByKey(key.(string))
if err == nil && stream != nil {
glog.V(3).Infof("Queued import of stream %s/%s...", stream.Namespace, stream.Name)
if err = handleImageStream(stream, c.isNamespacer, c.notifier); err == nil {
c.queue.Forget(key)
return true
}
if err != nil {
utilruntime.HandleError(fmt.Errorf("Error syncing image stream: %v", err))
c.queue.AddRateLimited(key)
return true
}
if stream == nil {
c.queue.Forget(key)
return true
}

utilruntime.HandleError(fmt.Errorf("Error syncing image stream: %v", err))
c.queue.AddRateLimited(key)
glog.V(3).Infof("Queued import of stream %s/%s...", stream.Namespace, stream.Name)
if err := handleImageStream(stream, c.isNamespacer, c.notifier); err != nil {
utilruntime.HandleError(fmt.Errorf("Error syncing image stream: %v", err))
c.queue.AddRateLimited(key)
return true
}

c.queue.Forget(key)
return true
}

Expand All @@ -146,14 +153,10 @@ func (c *ImageStreamController) getByKey(key string) (*imageapi.ImageStream, err
}
stream, err := c.lister.ImageStreams(namespace).Get(name)
if apierrs.IsNotFound(err) {
// TODO: this is not normal and should be refactored
return nil, nil
}
if err != nil {
glog.Infof("Unable to retrieve image stream %q from store: %v", key, err)
return nil, err
}

return stream, nil
return stream, err
}

// tagImportable is true if the given TagReference is importable by this controller
Expand Down

0 comments on commit e183ec5

Please sign in to comment.