fix: push secret delete was removing the wrong key#5799
fix: push secret delete was removing the wrong key#5799Skarlso merged 2 commits intoexternal-secrets:mainfrom
Conversation
WalkthroughChanges update the PushSecret controller's secret deletion to use a different map key when removing entries, add test coverage for multi-property deletion cleanup, and modify the OnePassword provider to handle missing secrets as no-ops. Changes
Pre-merge checks✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
🧰 Additional context used🧬 Code graph analysis (1)pkg/controllers/pushsecret/pushsecret_controller_test.go (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/ok-to-test sha=e62f9722f8153c5cd5da5e60a63cc2c3a53f352e |
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
e62f972 to
1750760
Compare
|



Problem Statement
What is the problem you're trying to solve?
Related Issue
Fixes #5753
Proposed Changes
How do you like to solve the issue and why?
Format
Please ensure that your PR follows the following format for the title:
Where
scopeis optionally one of:Checklist
git commit --signoffmake testmake reviewableSummary
Fixes a bug where deleting a PushSecret with multiple fields would remove the wrong key from the internal tracking map, causing deletion to hang and leave orphaned 1Password items.
Changes
pkg/controllers/pushsecret/pushsecret_controller.go
DeleteSecretFromProvidersto useoldEntryinstead ofoldRef.Match.RemoteRef.RemoteKeywhen removing secrets from the SyncedPushSecretsMap, ensuring the correct key is removed during deletion.providers/v1/onepassword/onepassword.go
DeleteSecretto treatErrKeyNotFoundas a no-op (returning nil) instead of propagating the error, allowing graceful handling when a key is already missing.pkg/controllers/pushsecret/pushsecret_controller_test.go
syncAndDeleteWithPropertiestest scenario to verify correct cleanup of the SyncedPushSecrets status map when a PushSecret with multiple properties is deleted.