From d22657565e7f327aea5b4e5a9ce9c2d54f8c54fa Mon Sep 17 00:00:00 2001 From: Krzysztof Ostrowski Date: Tue, 23 Jan 2024 10:24:24 +0100 Subject: [PATCH] pkg/tls: change deprecated upstream funcs --- pkg/tls/reloader_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/tls/reloader_test.go b/pkg/tls/reloader_test.go index 3494b1958..50c2836db 100644 --- a/pkg/tls/reloader_test.go +++ b/pkg/tls/reloader_test.go @@ -335,7 +335,8 @@ func writeTempFile(pattern string, data []byte) (string, error) { func poll(interval, timeout time.Duration, f func() error) error { var lastErr error - err := wait.Poll(interval, timeout, func() (bool, error) { + ctx := context.Background() + err := wait.PollUntilContextTimeout(ctx, interval, timeout, true, func(_ context.Context) (bool, error) { lastErr = f() if lastErr != nil { @@ -346,7 +347,7 @@ func poll(interval, timeout time.Duration, f func() error) error { return true, nil }) - if err != nil && err == wait.ErrWaitTimeout && lastErr != nil { + if err != nil && wait.Interrupted(err) && lastErr != nil { err = fmt.Errorf("%v: %v", err, lastErr) }