Skip to content

Commit

Permalink
fix infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
moycat committed Jan 29, 2022
1 parent ee7398e commit c0ffde5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/shiba.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func NewShiba(client kubernetes.Interface, nodeName, cniConfigPath string, optio
func (shiba *Shiba) Run(stopCh <-chan struct{}) error {
go shiba.execute(stopCh)
go shiba.periodicFire(stopCh)
watchLoop:
for {
watcher, err := shiba.client.CoreV1().Nodes().Watch(context.Background(), metav1.ListOptions{})
if err != nil {
Expand All @@ -94,7 +95,7 @@ func (shiba *Shiba) Run(stopCh <-chan struct{}) error {
case event, ok := <-watcherCh:
if !ok {
log.Info("watch channel closed")
break
continue watchLoop
}
shiba.processEvent(event)
}
Expand Down

0 comments on commit c0ffde5

Please sign in to comment.