Skip to content

fix: write Profile failure conditions through the status subresource - #482

Open
rishabhsai wants to merge 1 commit into
kubeflow:mainfrom
rishabhsai:fix-profile-status-conditions
Open

rishabhsai wants to merge 1 commit into
kubeflow:mainfrom
rishabhsai:fix-profile-status-conditions

Conversation

@rishabhsai

Copy link
Copy Markdown
Contributor

closes: #481

The Profile CRD has the status subresource enabled, but appendErrorConditionAndReturn saved the Failed condition with a plain Update, 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().Update and 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 in controllers/profile_status_test.go reconciles 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, and make test is otherwise unchanged.

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
@google-oss-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign thesuperzapper for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow Bot added the area/profiles area - related to profile-controller label Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/profiles area - related to profile-controller size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Profile controller never stores its Failed status condition

1 participant