Merge pull request #87718 from wojtek-t/kubelet_not_watching_immutable_secret_configmaps

WatchBasedManager stops  watching immutable objects
This commit is contained in:
Kubernetes Prow Robot
2020-02-11 23:14:33 -08:00
committed by GitHub
6 changed files with 226 additions and 15 deletions

View File

@@ -57,7 +57,10 @@ func TestWatchBasedManager(t *testing.T) {
return client.CoreV1().Secrets(namespace).Watch(context.TODO(), options)
}
newObj := func() runtime.Object { return &v1.Secret{} }
store := manager.NewObjectCache(listObj, watchObj, newObj, schema.GroupResource{Group: "v1", Resource: "secrets"})
// We want all watches to be up and running to stress test it.
// So don't treat any secret as immutable here.
isImmutable := func(_ runtime.Object) bool { return false }
store := manager.NewObjectCache(listObj, watchObj, newObj, isImmutable, schema.GroupResource{Group: "v1", Resource: "secrets"})
// create 1000 secrets in parallel
t.Log(time.Now(), "creating 1000 secrets")