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

VDS: properly handle the clone cache key variant during client callback execution #835

Conversation

benashz
Copy link
Collaborator

@benashz benashz commented Jun 28, 2024

In the case where a VaultDynamicSecret instance specifies a Vault namespace that is different from its VaultAuth the ClientCacheKey will be of the clone variant. The cache key format is different from its parent cache key and therefore a parent and a clone cannot be compared. Since the VDS controller stores the clone variant in its state, all instances of this type were ignored during a client callback reconciliation. This would leave unreconciled VDS instances upon client token expiration or other LifetimeWatcher errors.

…ck execution.

In the case where a VaultDynamicSecret instance specifies a Vault namespace that is different from its VaultAuth the ClientCacheKey will be of the clone variant. The cache key format is different from its parent cache key and therefore a parent and a clone cannot be compared. Since the VDS controller stores the clone variant in its state, all instances of this type were ignored during a client callback reconciliation. This would leave unreconciled VDS instances upon client token expiration or other LifetimeWatcher errors.
Other fixes:
- ensure the vault client ID is set on a Client clone
- add unit tests for Client.Clone()
@benashz benashz marked this pull request as ready for review July 5, 2024 21:15
@benashz benashz requested a review from a team as a code owner July 5, 2024 21:15
@benashz benashz requested review from tvoran and thyton July 5, 2024 21:16
internal/vault/cache_key_test.go Outdated Show resolved Hide resolved
test/integration/vaultdynamicsecret_integration_test.go Outdated Show resolved Hide resolved
controllers/vaultdynamicsecret_controller.go Outdated Show resolved Hide resolved
@benashz benashz added this to the v0.8.0 milestone Jul 9, 2024
@benashz benashz merged commit 47d9162 into main Jul 9, 2024
42 checks passed
@benashz benashz deleted the VAULT-28278/fix-vds-cbs-properly-handle-namespaced-client-cache-key branch July 9, 2024 15:35
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

Successfully merging this pull request may close these issues.

2 participants