mirror of
https://github.com/1Password/onepassword-operator.git
synced 2025-10-22 07:28:06 +00:00
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
This commit is contained in:
@@ -104,8 +104,8 @@ func (r *DeploymentReconciler) Reconcile(ctx context.Context, req ctrl.Request)
|
|||||||
// Handles creation or updating secrets for deployment if needed
|
// Handles creation or updating secrets for deployment if needed
|
||||||
if err = r.handleApplyingDeployment(deployment, deployment.Namespace, annotations, req); err != nil {
|
if err = r.handleApplyingDeployment(deployment, deployment.Namespace, annotations, req); err != nil {
|
||||||
if strings.Contains(err.Error(), "rate limit") {
|
if strings.Contains(err.Error(), "rate limit") {
|
||||||
reqLogger.V(logs.InfoLevel).Info("1Password rate limit hit. Requeuing after 1 minute.")
|
reqLogger.V(logs.InfoLevel).Info("1Password rate limit hit. Requeuing after 15 minutes.")
|
||||||
return ctrl.Result{RequeueAfter: time.Minute}, nil
|
return ctrl.Result{RequeueAfter: 15 * time.Minute}, nil
|
||||||
} else {
|
} else {
|
||||||
return ctrl.Result{}, err
|
return ctrl.Result{}, err
|
||||||
}
|
}
|
||||||
|
@@ -107,8 +107,8 @@ func (r *OnePasswordItemReconciler) Reconcile(ctx context.Context, req ctrl.Requ
|
|||||||
err = r.handleOnePasswordItem(onepassworditem, req)
|
err = r.handleOnePasswordItem(onepassworditem, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if strings.Contains(err.Error(), "rate limit") {
|
if strings.Contains(err.Error(), "rate limit") {
|
||||||
reqLogger.V(logs.InfoLevel).Info("1Password rate limit hit. Requeuing after 1 minute.")
|
reqLogger.V(logs.InfoLevel).Info("1Password rate limit hit. Requeuing after 15 minutes.")
|
||||||
return ctrl.Result{RequeueAfter: time.Minute}, nil
|
return ctrl.Result{RequeueAfter: 15 * time.Minute}, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if updateStatusErr := r.updateStatus(onepassworditem, err); updateStatusErr != nil {
|
if updateStatusErr := r.updateStatus(onepassworditem, err); updateStatusErr != nil {
|
||||||
|
Reference in New Issue
Block a user