mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 16:29:21 +00:00
generate code that passes go vet
* Make sure sync.RWMutex values aren't copied.
This commit is contained in:
parent
f61630ea27
commit
44a9cc55b8
@ -125,9 +125,10 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fakePtr := testing.Fake{}
|
cs := &Clientset{}
|
||||||
fakePtr.AddReactor("*", "*", testing.ObjectReaction(o))
|
cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake}
|
||||||
fakePtr.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) {
|
cs.AddReactor("*", "*", testing.ObjectReaction(o))
|
||||||
|
cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) {
|
||||||
gvr := action.GetResource()
|
gvr := action.GetResource()
|
||||||
ns := action.GetNamespace()
|
ns := action.GetNamespace()
|
||||||
watch, err := o.Watch(gvr, ns)
|
watch, err := o.Watch(gvr, ns)
|
||||||
@ -137,7 +138,7 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset {
|
|||||||
return true, watch, nil
|
return true, watch, nil
|
||||||
})
|
})
|
||||||
|
|
||||||
return &Clientset{fakePtr, &fakediscovery.FakeDiscovery{Fake: &fakePtr}}
|
return cs
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clientset implements clientset.Interface. Meant to be embedded into a
|
// Clientset implements clientset.Interface. Meant to be embedded into a
|
||||||
|
Loading…
Reference in New Issue
Block a user