Skip to content

Commit

Permalink
Deleted image streams are never removed from controller queue
Browse files Browse the repository at this point in the history
If an image stream was deleted, it was never released from the queue.
  • Loading branch information
smarterclayton committed Jul 7, 2017
1 parent 778ab8d commit 0d0c686
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 0d0c686

Please sign in to comment.