Skip to content

Commit

Permalink
chore: Replace deprecated Poll with PollUntilContextTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
dmage authored and openshift-merge-robot committed Aug 21, 2023
1 parent 618b99a commit c3b4657
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions controllers/quay/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,12 @@ func (r *QuayRegistryReconciler) checkRoutesAvailable(
// Wait until `status.ingress` is populated (should be immediately).
r.Log.Info("cluster supports `Routes` API")
var rt routev1.Route
if err := wait.Poll(
if err := wait.PollUntilContextTimeout(
ctx,
time.Second,
5*time.Minute,
func() (done bool, err error) {
false,
func(ctx context.Context) (done bool, err error) {
routensn := types.NamespacedName{
Name: fmt.Sprintf("%s-test-route", quay.GetName()),
Namespace: quay.GetNamespace(),
Expand Down
6 changes: 4 additions & 2 deletions controllers/quay/quayregistry_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -921,10 +921,12 @@ func (r *QuayRegistryReconciler) createOrUpdateObject(
return err
}

if err := wait.Poll(
if err := wait.PollUntilContextTimeout(
ctx,
creationPollInterval,
creationPollTimeout,
func() (bool, error) {
false,
func(ctx context.Context) (bool, error) {
if err := r.Client.Create(ctx, obj); err != nil {
if errors.IsAlreadyExists(err) {
log.Info("immutable resource being deleted, retry")
Expand Down

0 comments on commit c3b4657

Please sign in to comment.