pkg/registry/core/pod/storage: add PDB-specific CauseType to eviction forbidden errors#138003
Conversation
|
Welcome @shady0503! |
|
Hi @shady0503. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
e678125 to
4a9fcf7
Compare
|
/easycla |
|
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
1 similar comment
|
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
|
/label api-review |
|
/assign @tallclair |
|
@tallclair PTAL, this needs approval for pkg/registry/core/pod when you have a moment. CI is green. |
|
/lgtm |
e44f4b8 to
3d4b0dd
Compare
…en errors When checkAndDecrement returns a Forbidden error due to negative DisruptionsAllowed or an oversized DisruptedPods map, clients had no way to distinguish these from other Forbidden errors without string-matching on the message. Populate StatusCause with the existing DisruptionBudgetCause on both Forbidden error paths, consistent with the existing pattern on the TooManyRequests path. Fixes: kubernetes#125500
3d4b0dd to
507d980
Compare
|
/retest |
|
LGTM label has been added. DetailsGit tree hash: c89dee988b3d0fafe155b5f25167669543a5fda6 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: atombrella, liggitt, shady0503, soltysh The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
What this PR does / why we need it:
When
checkAndDecrementreturns aForbiddenerror due to negativeDisruptionsAllowedor an oversizedDisruptedPodsmap, clients had no programmatic way to distinguish these from otherForbiddenerrors without string-matching on the message.This PR adds two new
CauseTypeconstants topolicy/v1:DisruptionBudgetNegativeAllowedDisruptions— for theDisruptionsAllowed < 0caseDisruptionBudgetTooManyDisruptedPods— for theDisruptedPodsmap overflow caseAnd populates
StatusCauseon bothForbiddenerror paths incheckAndDecrement, consistent with the existing pattern already used on theTooManyRequestspath viaDisruptionBudgetCause.Clients can now use
errors.HasStatusCause(err, policyv1.DisruptionBudgetNegativeAllowedDisruptions)for reliable, typed, machine-readable error discrimination, no message parsing needed.Which issue(s) this PR is related to:
Fixes #125500
Special notes:
The two new
CauseTypeconstants follow the same naming convention and placement as the existingDisruptionBudgetCauseconstant instaging/src/k8s.io/api/policy/v1/types.go. No codegen changes were required sinceCauseTypeis astringalias.Does this PR introduce a user-facing change?