fix: stop informer manager Instance once

Signed-off-by: yvoilee <yvoilee@gmail.com>
This commit is contained in:
Leo 2021-10-29 10:43:41 +08:00 committed by yvoilee
parent 943733b6a7
commit f698881e1f
No known key found for this signature in database
GPG Key ID: E2BF6F9775683F33
1 changed files with 2 additions and 1 deletions

View File

@ -11,6 +11,7 @@ import (
var (
instance MultiClusterInformerManager
once sync.Once
stopOnce sync.Once
stopCh chan struct{}
)
@ -28,7 +29,7 @@ func GetInstance() MultiClusterInformerManager {
// StopInstance will stop the shared MultiClusterInformerManager instance.
func StopInstance() {
once.Do(func() {
stopOnce.Do(func() {
close(stopCh)
})
}