Skip to content

Commit 193cd5d

Browse files
vdemeestertekton-robot
authored andcommitted
e2e: migrate wait.PollImmediate deprecated functions
This function is deprecated, see [1]. Replacing it with PollUntilContextTimeout which is what is recommended. [1]: https://pkg.go.dev/k8s.io/apimachinery/pkg/util/wait#PollImmediate Signed-off-by: Vincent Demeester <[email protected]>
1 parent 7f6b52f commit 193cd5d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ func verifyServiceAccountExistence(ctx context.Context, t *testing.T, namespace
178178
defaultSA := getDefaultSA(ctx, t, kubeClient, namespace)
179179
t.Logf("Verify SA %q is created in namespace %q", defaultSA, namespace)
180180

181-
if err := wait.PollImmediate(interval, timeout, func() (bool, error) {
181+
if err := wait.PollUntilContextTimeout(ctx, interval, timeout, true, func(context.Context) (bool, error) {
182182
_, err := kubeClient.CoreV1().ServiceAccounts(namespace).Get(ctx, defaultSA, metav1.GetOptions{})
183183
if err != nil && errors.IsNotFound(err) {
184184
return false, nil

test/wait.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const (
7070
type ConditionAccessorFn func(ca apis.ConditionAccessor) (bool, error)
7171

7272
func pollImmediateWithContext(ctx context.Context, fn func() (bool, error)) error {
73-
return wait.PollImmediate(interval, timeout, func() (bool, error) {
73+
return wait.PollUntilContextTimeout(ctx, interval, timeout, true, func(context.Context) (bool, error) {
7474
select {
7575
case <-ctx.Done():
7676
return true, ctx.Err()

0 commit comments

Comments
 (0)