Skip to content

Commit

Permalink
pkg/tls: change deprecated upstream funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
ibihim committed Jan 23, 2024
1 parent 3703e8d commit d226575
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/tls/reloader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
}

Expand Down

0 comments on commit d226575

Please sign in to comment.