fed: Fix flakey ingress unit test
The unit test for the ingress controller was previously adding a cluster twice, which resulted in a cluster being deleted and added back. The deletion was racing the controller shutdown to close informer channels. This change ensures that the informer clears its map of informers when Stop() is called to prevent a double close, and that the test no longer adds the cluster twice.
This commit is contained in:
@@ -281,6 +281,10 @@ func (f *federatedInformerImpl) Stop() {
|
||||
for key, informer := range f.targetInformers {
|
||||
glog.V(4).Infof("... Closing informer channel for %q.", key)
|
||||
close(informer.stopChan)
|
||||
// Remove each informer after it has been stopped to prevent
|
||||
// subsequent cluster deletion from attempting to double close
|
||||
// an informer's stop channel.
|
||||
delete(f.targetInformers, key)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user