@@ -195,6 +195,13 @@ func (c *Controller) workerController(stopCh <-chan struct{}) {
195195
196196 // process items from queue
197197 cluster , err := c .getNextWorkItem (key )
198+ if err != nil && k8errors .IsNotFound (err ) {
199+ // If the cluster has disappeared, do not re-queue
200+ glog .Infof ("Removing issuer %q from processing queue" , key )
201+ c .queue .Forget (obj )
202+ return nil
203+ }
204+
198205 if err != nil {
199206 return fmt .Errorf ("failed to get cluster: %s" , err )
200207 }
@@ -248,6 +255,11 @@ func (c *Controller) workerRecouncile(stopCh <-chan struct{}) {
248255 // process items from queue
249256 cluster , err := c .getNextWorkItem (key )
250257 if err != nil {
258+ if k8errors .IsNotFound (err ) {
259+ // key was removed from map, don't reconcile.
260+ glog .Infof ("Removing issuer %q from reconcile queue" , key )
261+ return nil
262+ }
251263 return fmt .Errorf ("failed to get cluster: %s" , err )
252264 }
253265
@@ -283,7 +295,7 @@ func (c *Controller) getNextWorkItem(key string) (*api.MysqlCluster, error) {
283295 if err != nil {
284296 if k8errors .IsNotFound (err ) {
285297 glog .Errorf ("resource not found: %s" , err )
286- return nil , fmt . Errorf ( "issuer %q in work queue no longer exists" , key )
298+ return nil , err
287299 }
288300
289301 return nil , err
0 commit comments