You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TODO(mml): Add a Retry-After header. Once there are time-based
307
+
// budgets, we can sometimes compute a sensible suggested value. But
308
+
// even without that, we can give a suggestion (10 minutes?) that
309
+
// prevents well-behaved clients from hammering us.
310
+
err:=errors.NewTooManyRequests("Cannot evict pod as it would violate the pod's disruption budget.", 0)
311
+
err.ErrStatus.Details.Causes=append(err.ErrStatus.Details.Causes, metav1.StatusCause{Type: "DisruptionBudget", Message: fmt.Sprintf("The disruption budget %s is still being processed by the server.", name)})
312
+
returnerr
313
+
}
314
+
271
315
// checkAndDecrement checks if the provided PodDisruptionBudget allows any disruption.
// TODO(mml): Add a Retry-After header. Once there are time-based
275
-
// budgets, we can sometimes compute a sensible suggested value. But
276
-
// even without that, we can give a suggestion (10 minutes?) that
277
-
// prevents well-behaved clients from hammering us.
278
-
err:=errors.NewTooManyRequests("Cannot evict pod as it would violate the pod's disruption budget.", 0)
279
-
err.ErrStatus.Details.Causes=append(err.ErrStatus.Details.Causes, metav1.StatusCause{Type: "DisruptionBudget", Message: fmt.Sprintf("The disruption budget %s is still being processed by the server.", pdb.Name)})
280
-
returnerr
318
+
319
+
returncreateTooManyRequestsError(pdb.Name)
281
320
}
282
321
ifpdb.Status.DisruptionsAllowed<0 {
283
322
returnerrors.NewForbidden(policy.Resource("poddisruptionbudget"), pdb.Name, fmt.Errorf("pdb disruptions allowed is negative"))
0 commit comments