1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-02 15:54:32 +00:00

Add ignorable error to bypass requeue

This commit is contained in:
Darren Shepherd
2017-12-16 01:21:53 -07:00
parent f26502f753
commit 227e9f7ca0
2 changed files with 10 additions and 1 deletions

9
controller/error.go Normal file
View File

@@ -0,0 +1,9 @@
package controller
type ForgetError struct {
Err error
}
func (f *ForgetError) Error() string {
return f.Err.Error()
}

View File

@@ -162,7 +162,7 @@ func (g *genericController) processNextWorkItem() bool {
// do your work on the key. This method will contains your "do stuff" logic // do your work on the key. This method will contains your "do stuff" logic
err := g.syncHandler(key.(string)) err := g.syncHandler(key.(string))
if err == nil { if _, ok := err.(*ForgetError); err == nil || ok {
g.queue.Forget(key) g.queue.Forget(key)
return true return true
} }