mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-05-28 04:04:39 -04:00
Merge pull request #135052 from p0lyn0mial/upstream-watchlist-unsupported-wl-fix-test-gc-test
pkg/controller/garbagecollector/garbagecollector_test: wrap kubeClient with a client that doesn't support WatchList semantics.
This commit is contained in:
commit
1c875ca501
1 changed files with 11 additions and 1 deletions
|
|
@ -818,6 +818,14 @@ func TestGetDeletableResources(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
type wrappedKubeClientWithUnsupportedWatchListSemantics struct {
|
||||
kubernetes.Interface
|
||||
}
|
||||
|
||||
func (c *wrappedKubeClientWithUnsupportedWatchListSemantics) IsWatchListSemanticsUnSupported() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// TestGarbageCollectorSync ensures that a discovery client error
|
||||
// or an informer sync error will not cause the garbage collector
|
||||
// to block infinitely.
|
||||
|
|
@ -889,10 +897,12 @@ func TestGarbageCollectorSync(t *testing.T) {
|
|||
srv, clientConfig := testServerAndClientConfig(alternativeTestHandler)
|
||||
defer srv.Close()
|
||||
clientConfig.ContentConfig.NegotiatedSerializer = nil
|
||||
client, err := kubernetes.NewForConfig(clientConfig)
|
||||
kubeClient, err := kubernetes.NewForConfig(clientConfig)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// TODO(#115478): migrate this test to use fakeClient instead of the real client.
|
||||
client := &wrappedKubeClientWithUnsupportedWatchListSemantics{kubeClient}
|
||||
|
||||
tweakableRM := meta.NewDefaultRESTMapper(nil)
|
||||
tweakableRM.AddSpecific(schema.GroupVersionKind{Version: "v1", Kind: "Pod"}, schema.GroupVersionResource{Version: "v1", Resource: "pods"}, schema.GroupVersionResource{Version: "v1", Resource: "pod"}, meta.RESTScopeNamespace)
|
||||
|
|
|
|||
Loading…
Reference in a new issue