Repository navigation
fix(operator): keep an existing target and the connection token intact when keys are missing - #287
Conversation
…t when keys are missing
There was a problem hiding this comment.
The guards look correct. A partial reveal no longer rewrites an existing target. An empty reveal doesn't create an empty Secret. A target that holds the connection token is only written when the token key is present, and it no longer carries an owner reference, so deleting the CR won't garbage-collect it. Missing keys now requeue within a minute. The tests cover each of these paths.
Nit: targetContentHash in ferrvaultsecret_sync.go (around line 198) still works out the target name by hand. Replace those four lines with name := targetName(cr) so every caller uses the same lookup. That code isn't in the diff, so I couldn't attach a suggestion to it.
…the owner UID fixture
|
Applied the targetName nit in targetContentHash, and renamed the owner UID test constant that gitleaks read as a key (it is a fixed fake UID). Kept the small owner-ref helper: RemoveOwnerReference errors when the reference is absent, so the helper stays simpler than a HasOwnerReference guard plus RemoveOwnerReference. |
## [5.3.3] - 2026-10-07 ### Bug Fixes - fix(operator): keep an existing target and the connection token intact when keys are missing (#287)
Makes it safe for a FerrVaultSecret to sync a connection's own token Secret, so operator tokens can be rotated from FerrVault (create the new token into the vault, the operator writes it into the token Secret, then revoke the old one).
What changed:
Data=nil,StringData=found), so a missing key deleted the value from a working Secret.tokenSecretRef, the FerrVaultSecret no longer sets itself as controller owner (and drops an existing reference). Deleting the FerrVaultSecret, or a Flux prune, would otherwise garbage-collect the token and lock the connection out.tokenSecretRef.key, the target is left alone with Ready=False TokenKeyMissing.New targets with a partial reveal are still created with the keys found, as before.
Tests in
ferrvaultsecret_guard_test.gocover each case; breaking the missing-key guard or the ownership skip makes them fail.go test -race ./...passes locally. golangci-lint was not available locally, CI runs it.