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

add crash when failure in list or watch of kubernetes api server #1322

Closed
wants to merge 1 commit into from
Closed
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
12 changes: 10 additions & 2 deletions subnet/kube/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,18 @@ func newKubeSubnetManager(c clientset.Interface, sc *subnet.Config, nodeName, pr
indexer, controller := cache.NewIndexerInformer(
&cache.ListWatch{
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
return ksm.client.CoreV1().Nodes().List(options)
obj, err := ksm.client.CoreV1().Nodes().List(options)
if err != nil {
glog.Exit(err, "failed to list nodes in newKubeSubnetManager")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why quit? This should recover on its own.

}
return obj, err
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
return ksm.client.CoreV1().Nodes().Watch(options)
iface, err := ksm.client.CoreV1().Nodes().Watch(options)
if err != nil {
glog.Exit(err, "failed to watch nodes in newKubeSubnetManager")
}
return iface, err
},
},
&v1.Node{},
Expand Down