Skip to content

Commit

Permalink
Merge pull request #114 from butonic/registry/kubernetes/watcher-fix
Browse files Browse the repository at this point in the history
only close channel once
  • Loading branch information
asim authored Jun 5, 2023
2 parents d4d5318 + 51f3d8c commit a179a6b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion v4/registry/kubernetes/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type k8sWatcher struct {

sync.RWMutex
pods map[string]*client.Pod
sync.Once
}

// build a cache of pods when the watcher starts.
Expand Down Expand Up @@ -164,7 +165,9 @@ func (k *k8sWatcher) Stop() {
case <-k.next:
return
default:
close(k.next)
k.Do(func() {
close(k.next)
})
}
}

Expand Down

0 comments on commit a179a6b

Please sign in to comment.