Closing stopCh when pod_store is not created

If there is an error and pod store is not created, reflector should be stopped.
This commit is contained in:
Krzysztof Siedlecki 2019-07-04 13:41:14 +02:00 committed by GitHub
parent f978c4cab5
commit 1e7a4d1cd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,6 +61,7 @@ func NewPodStore(c clientset.Interface, namespace string, label labels.Selector,
} }
return false, nil return false, nil
}); err != nil { }); err != nil {
close(stopCh)
return nil, err return nil, err
} }
return &PodStore{Store: store, stopCh: stopCh, Reflector: reflector}, nil return &PodStore{Store: store, stopCh: stopCh, Reflector: reflector}, nil