Skip to content

Commit

Permalink
wait2.PollImmediate is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
jcpowermac committed Feb 26, 2024
1 parent 3e265d8 commit fce3d1e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ func (s *StatusOptions) GetStatus() string {
// An error will not result in immediate failure and will be retried.
func (s *StatusOptions) WaitForStatusReport(ctx context.Context, sclient sonobuoyclient.Interface) error {
tries := 1
err := wait2.PollImmediateUntilWithContext(ctx, s.waitInterval, func(ctx context.Context) (done bool, err error) {

err := wait2.PollUntilContextCancel(ctx, s.waitInterval, true, func(ctx context.Context) (done bool, err error) {
if tries == StatusRetryLimit {
return false, errors.New("retry limit reached checking for aggregator status")
}
Expand All @@ -189,7 +190,7 @@ func (s *StatusOptions) Print(cmd *cobra.Command, sclient sonobuoyclient.Interfa
}

tries := 1
return wait2.PollImmediateInfiniteWithContext(cmd.Context(), s.waitInterval, func(ctx context.Context) (done bool, err error) {
return wait2.PollUntilContextCancel(cmd.Context(), s.waitInterval, true, func(ctx context.Context) (done bool, err error) {
if tries == StatusRetryLimit {
// we hit back-to-back errors too many times.
return true, errors.New("retry limit reached checking status")
Expand Down

0 comments on commit fce3d1e

Please sign in to comment.