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

View File

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