Repository navigation
fix: write Profile failure conditions through the status subresource - #482
Open
rishabhsai wants to merge 1 commit into
Open
rishabhsai wants to merge 1 commit into
rishabhsai wants to merge 1 commit into
Conversation
The Profile CRD enables the status subresource, so the API server drops status changes sent with a plain Update. appendErrorConditionAndReturn used Update, which meant the Failed condition for a namespace owned by someone else (or one that never became ready) was never stored, and the only trace of the failure was the controller log. Write the condition with Status().Update. Skip the write when the same Failed condition is already present. Otherwise every status write would trigger another reconcile that appends one more copy. The new envtest spec runs Reconcile twice against a namespace owned by another user. It expects exactly one Failed condition on the stored Profile. Signed-off-by: Rishabh <rishabhsaiv@gmail.com> Assisted-by: Claude
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes: #481
The Profile CRD has the status subresource enabled, but
appendErrorConditionAndReturnsaved the Failed condition with a plainUpdate, so the API server dropped it. A Profile whose namespace already belonged to someone else showed no status at all, and the only trace was the controller log.This writes the condition with
Status().Updateand skips the write when the same Failed condition is already there. Without that check, each status write requeues the Profile and the next reconcile appends another copy. The new envtest spec incontrollers/profile_status_test.goreconciles twice against a namespace owned by another user and expects exactly one Failed condition. It fails on main (no conditions stored) and passes with the fix, andmake testis otherwise unchanged.