Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleted image streams are never removed from controller queue #15099

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well here's your problem. Issue to do a more thorough refactor please.

}
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