Skip to content

Set the Role status to ERROR when its password Secret is missing - #94

Merged
ThoSap merged 2 commits into
mainfrom
fix-role-error-status-on-missing-password-secret
Oct 25, 2026
Merged

ThoSap merged 2 commits into
mainfrom
fix-role-error-status-on-missing-password-secret

Conversation

@ThoSap

@ThoSap ThoSap commented Oct 25, 2026

Copy link
Copy Markdown
Member

RoleReconciler read the password Secret before the try block. If the Secret was missing or had the wrong type, getSecretRefCredentials threw outside the try, so handleError did not run. The Role kept its old phase, for example READY, and observedGeneration stayed at the old generation, while each reconcile failed until JOSDK stopped the retries. The other five reconcilers do all their work inside the try and set ERROR in this case.

Found in the review of #91. It is the same type of bug as #89.

What changed

  1. The Secret is read inside the try block. A missing or invalid Secret now sets ERROR with the message, for example Secret reference not found [...], and the operator tries again after 60 seconds. When the Secret appears, the Secret event source still starts a reconcile at once.
  2. New test. A READY Role points passwordSecretRef to a missing Secret and must go to ERROR. Then it points back to the existing Secret and must go to READY.

Checks that CI cannot do

  • Without the fix in RoleReconciler, the new test fails: the status is never written, so the wait for observedGeneration times out.

@ThoSap ThoSap self-assigned this Oct 25, 2026
@ThoSap
ThoSap force-pushed the fix-role-error-status-on-missing-password-secret branch from 4284cf6 to c7e7bda Compare October 25, 2026 15:10
@ThoSap ThoSap changed the title Set the Role status to ERROR when its password Secret is missing Set the Role status to ERROR when its password Secret is missing Oct 25, 2026
@ThoSap
ThoSap merged commit 6f4e12b into main Oct 25, 2026
4 checks passed
@ThoSap
ThoSap deleted the fix-role-error-status-on-missing-password-secret branch October 25, 2026 15:23
@ThoSap ThoSap added the bug Something isn't working label Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant