From c95078c34c30041ae2a5d97bc8605a95a6866e4a Mon Sep 17 00:00:00 2001 From: Volodymyr Zotov Date: Mon, 9 Jun 2025 16:04:23 -0500 Subject: [PATCH] Retry after 15 minutes, if get rate-limit error As currently service account are last for 1 hour https://developer.1password.com/docs/service-accounts/rate-limits/#hourly-limits --- internal/controller/deployment_controller.go | 4 ++-- internal/controller/onepassworditem_controller.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/controller/deployment_controller.go b/internal/controller/deployment_controller.go index 032e8f8..af5c113 100644 --- a/internal/controller/deployment_controller.go +++ b/internal/controller/deployment_controller.go @@ -104,8 +104,8 @@ func (r *DeploymentReconciler) Reconcile(ctx context.Context, req ctrl.Request) // Handles creation or updating secrets for deployment if needed if err = r.handleApplyingDeployment(deployment, deployment.Namespace, annotations, req); err != nil { if strings.Contains(err.Error(), "rate limit") { - reqLogger.V(logs.InfoLevel).Info("1Password rate limit hit. Requeuing after 1 minute.") - return ctrl.Result{RequeueAfter: time.Minute}, nil + reqLogger.V(logs.InfoLevel).Info("1Password rate limit hit. Requeuing after 15 minutes.") + return ctrl.Result{RequeueAfter: 15 * time.Minute}, nil } else { return ctrl.Result{}, err } diff --git a/internal/controller/onepassworditem_controller.go b/internal/controller/onepassworditem_controller.go index edc502a..111f94a 100644 --- a/internal/controller/onepassworditem_controller.go +++ b/internal/controller/onepassworditem_controller.go @@ -107,8 +107,8 @@ func (r *OnePasswordItemReconciler) Reconcile(ctx context.Context, req ctrl.Requ err = r.handleOnePasswordItem(onepassworditem, req) if err != nil { if strings.Contains(err.Error(), "rate limit") { - reqLogger.V(logs.InfoLevel).Info("1Password rate limit hit. Requeuing after 1 minute.") - return ctrl.Result{RequeueAfter: time.Minute}, nil + reqLogger.V(logs.InfoLevel).Info("1Password rate limit hit. Requeuing after 15 minutes.") + return ctrl.Result{RequeueAfter: 15 * time.Minute}, nil } } if updateStatusErr := r.updateStatus(onepassworditem, err); updateStatusErr != nil {