Skip to content

Commit 9565440

Browse files
committed
fix(accesskey): tolerate missing password Secret during finalizer cleanup
helm uninstall deletes the password Secret and the AccessKey CR in the same operation; revocation goes through the admin credentials first, so the password is only needed for the user-scoped fallback. Previously the failed Secret read wedged the finalizer and hung the uninstall.
1 parent c40cf68 commit 9565440

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/reconcile/access_key.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,13 @@ async fn cleanup(obj: Arc<AccessKey>, ctx: &Context) -> Result<Action> {
281281
if known_ak.is_none() {
282282
return Ok(Action::await_change());
283283
}
284-
let password = secret_key_value(&ctx.client, &ns, &obj.spec.password_ref, "password").await?;
284+
// Best-effort password read: on `helm uninstall` the password Secret and
285+
// this CR are often deleted together. Revocation tries the admin
286+
// credentials first, so an empty password still succeeds; it is only
287+
// needed for the user-scoped fallback.
288+
let password = secret_key_value(&ctx.client, &ns, &obj.spec.password_ref, "password")
289+
.await
290+
.unwrap_or_default();
285291
let fs = provider_for(&ctx.client, &ns, &obj.spec.connection).await?;
286292
cleanup_access_key(
287293
&fs,

0 commit comments

Comments
 (0)