Skip to content

Commit

Permalink
Handle DeletedFinalStateUnknown in NodeController
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarek committed Oct 13, 2016
1 parent 4a223ef commit 8b7e9d3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion pkg/controller/node/nodecontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,20 @@ func NewNodeController(
return
}

node := obj.(*api.Node)
node, isNode := obj.(*api.Node)
// We can get DeletedFinalStateUnknown instead of *api.Node here and we need to handle that correctly. #34692
if !isNode {
deletedState, ok := obj.(cache.DeletedFinalStateUnknown)
if !ok {
glog.Errorf("Received unexpected object: %v", obj)
return
}
node, ok = deletedState.Obj.(*api.Node)
if !ok {
glog.Errorf("DeletedFinalStateUnknown contained non-Node object: %v", deletedState.Obj)
return
}
}
if err := nc.cidrAllocator.ReleaseCIDR(node); err != nil {
glog.Errorf("Error releasing CIDR: %v", err)
}
Expand Down

0 comments on commit 8b7e9d3

Please sign in to comment.