Files
cozystack/pkg/credentials/store
IvanHunters e88d9085b2 fix(apps): keep a racing create's winning Secret on cleanup
Two concurrent creates of one application could leave it with no account Secret. The create that lost the race cleaned up the Secret by name, but ownership of an application's credentials follows its HelmRelease, not a Secret's identity: the winning release can replace or adopt the very Secret the loser seeded, so neither an owner-reference check nor a UID identity check tells the loser's Secret from the winner's. The cleanup now deletes nothing once a HelmRelease for the application exists, which it provably does by the time a create fails with AlreadyExists, and otherwise deletes only the exact object it seeded. Ensure returns the UID it gave each seeded Secret for that last check.

Assisted-by: LLM
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
2026-11-17 20:27:41 +03:00
..