Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Old Secrets Deleted on Failed Update in BerglasSecretController #37

Open
Hi-king opened this issue Dec 25, 2024 · 0 comments
Open

Old Secrets Deleted on Failed Update in BerglasSecretController #37

Hi-king opened this issue Dec 25, 2024 · 0 comments

Comments

@Hi-king
Copy link

Hi-king commented Dec 25, 2024

Description

We've encountered a critical issue with the BerglasSecretController in our Kubernetes setup where old secrets are deleted whenever an update fails. This behavior results in an inability to roll back to a previous state since the old secrets are no longer available.

Steps to Reproduce

  1. Deploy an incorrectly configured BerglasSecret (e.g., invalid permissions).
  2. Introduce a failure in the update process.
  3. Observe that the old secret is deleted despite the update failure.

Expected Behavior

The expected behavior would be that if an update fails, the old secrets should not be deleted, preserving the ability to roll back to a previous state.

Actual Behavior

When an update fails, the old secrets are deleted, leaving no way to recover the previous secret values.

Possible Solution

A potential solution could be to implement a transactional mechanism where the old secrets are only deleted upon a successful update.

err = r.Delete(ctx, secret)

Here, the deletion is followed by a create operation, and failure at this step is problematic. Could we consider using a create-then-replace approach to simulate a transaction-like mechanism?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant