chore: bump vault version to 1.20 #144
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request refactors the Vault test setup in the
agent/secretsmgr
package to use Docker-based test clusters instead of in-memory Vault servers. This change improves test reliability and better simulates real-world scenarios. Key updates include replacing thecreateTestVault
function, updating imports, and modifying all test cases to use the new Docker-based setup.Important Note
We were importing entire vault project for testing and it has led to breaking package while upgrading:
https://github.com/hashicorp/vault/tree/c0f4c2052ef68e7cefe17ba171276158610f8ddd?tab=readme-ov-file#importing-vault
Refactor of Vault Test Setup
createTestVault
function was rewritten to usedocker.DockerCluster
from the Vault SDK, replacing the previous in-memory Vault server setup. This enhances test reliability and mirrors production environments more closely. (agent/secretsmgr/vault_test.go
, [1] [2]Test Case Updates
TestVaultManager_getSecret
,TestVaultManager_processString
,TestVaultManager_processMap
,TestVaultManager_processSlice
,TestVaultManager_SolvePolicySecrets
,TestVaultManager_RegisterUpdatePoliciesCallback
,TestVaultManager_pollSecrets
) were updated to use the new Docker-basedcreateTestVault
function. The cleanup logic was simplified withcluster.Cleanup
. (agent/secretsmgr/vault_test.go
, [1] [2] [3] [4] [5] [6]Import Adjustments
net
,vaulthttp
,vaultsrv
) were removed. New imports for Docker-based test clusters (testcluster
,testcluster/docker
) were added. (agent/secretsmgr/vault_test.go
, agent/secretsmgr/vault_test.goL7-R79)Address Handling
cluster.ClusterNodes[0].HostPort
instead ofln.Addr().String()
for Vault server address configuration. (agent/secretsmgr/vault_test.go
, agent/secretsmgr/vault_test.goL612-R595)