Add Until based on RetryWatcher

This commit is contained in:
Tomas Nozicka
2019-01-03 13:45:46 +01:00
parent 836db5c90e
commit 09af8485f2
5 changed files with 922 additions and 2 deletions

View File

@@ -172,6 +172,21 @@ func TestWatchRestartsIfTimeoutNotReached(t *testing.T) {
}, // regular watcher; unfortunately destined to fail
normalizeOutputFunc: noopNormalization,
},
{
name: "RetryWatcher survives closed watches",
succeed: true,
secret: newTestSecret("secret-02"),
getWatcher: func(c *kubernetes.Clientset, secret *v1.Secret) (watch.Interface, error, func()) {
lw := &cache.ListWatch{
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
return getWatchFunc(c, secret)(options)
},
}
w, err := watchtools.NewRetryWatcher(secret.ResourceVersion, lw)
return w, err, func() { <-w.Done() }
},
normalizeOutputFunc: noopNormalization,
},
{
name: "InformerWatcher survives closed watches",
succeed: true,