-
Notifications
You must be signed in to change notification settings - Fork 113
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
Periodically Cleanup Orphaned Shadow Secrets #980
base: main
Are you sure you want to change the base?
Conversation
… the secret to the hvsapp instead of the other way around in the original
…et if app is not found or if it's owner ref id does not match the apps uid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor comments, this is looking pretty good.
Co-authored-by: Theron Voran <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting there. I think we need to probably implement a few interfaces to avoid extra code duplication. We also want to to delegate running the cache pruner to the controller-runtime Manager. Happy to sync up with you on that.
299d06f
to
6fb9622
Compare
688e364
to
6fb9622
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there, this worked locally for me following the reproduction steps in the jira card.
Co-authored-by: Theron Voran <[email protected]>
Co-authored-by: Theron Voran <[email protected]>
…e-cleanup-shadow-secrets' into jaireddjawed-feature-cleanup-shadow-secrets
Description
When an
HCPVaultSecretsApp
is deleted, thehandleDeletion()
method is called to remove the app's shadow secrets from k8s. However, ifhandleDeletion()
fails to remove the secrets for some reason, the orphaned shadow secrets remain in k8s indefinitely because we don't have a mechanism that attempts to remove these shadow secrets again later.This PR addresses this issue by creating a goroutine that periodically checks for deleted HVS apps and removes the app's shadow secrets.
Local Testing
Reconcile()
This is to mock the scenario where the firsthandleDeletion()
call fails (mentioned here).kubectl get secrets -o yaml
)kubectl delete hcpvaultsecretsapps.secrets.hashicorp.com web-application
)kubectl get secrets -o yaml
)Jira Ticket
https://hashicorp.atlassian.net/browse/VAULT-31820