mirror of
https://github.com/kubernetes/client-go.git
synced 2026-01-04 23:24:03 +00:00
Fix duped watch in client-go/testing.
This commit fixes a bug in the client-go/testing fixture whereby a watcher would fire twice for objects with no namespace. Kubernetes-commit: bd268c9971efd4db46074a80e52ce765583e0787
This commit is contained in:
committed by
Kubernetes Publisher
parent
117d288bbe
commit
93c815ca99
@@ -339,8 +339,10 @@ func (t *tracker) getWatches(gvr schema.GroupVersionResource, ns string) []*watc
|
||||
if w := t.watchers[gvr][ns]; w != nil {
|
||||
watches = append(watches, w...)
|
||||
}
|
||||
if w := t.watchers[gvr][""]; w != nil {
|
||||
watches = append(watches, w...)
|
||||
if ns != metav1.NamespaceAll {
|
||||
if w := t.watchers[gvr][metav1.NamespaceAll]; w != nil {
|
||||
watches = append(watches, w...)
|
||||
}
|
||||
}
|
||||
}
|
||||
return watches
|
||||
|
||||
Reference in New Issue
Block a user