Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
test/components/util: make getting DaemonSet and Deployment more robust
Browse files Browse the repository at this point in the history
If we fail to get it and we get some error from API server, hope that
this is trancient and retry. This should mitigate hitting errors like
'etcdserver: leader changed'.

Signed-off-by: Mateusz Gozdek <[email protected]>
  • Loading branch information
invidian committed Nov 19, 2020
1 parent d896a97 commit a72fb81
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/components/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ func WaitForDaemonSet(t *testing.T, client kubernetes.Interface, ns, name string
return false, nil
}

return false, fmt.Errorf("getting DaemonSet %q: %w", name, err)
t.Logf("getting DaemonSet %q: %v", name, err)

return false, nil
}
replicas := ds.Status.DesiredNumberScheduled

Expand Down Expand Up @@ -204,7 +206,9 @@ func WaitForDeployment(t *testing.T, client kubernetes.Interface, ns, name strin
return false, nil
}

return false, fmt.Errorf("getting Deployment %q: %w", name, err)
t.Logf("getting Deployment %q: %v", name, err)

return false, nil
}

replicas := deploy.Status.Replicas
Expand Down

0 comments on commit a72fb81

Please sign in to comment.