-
Notifications
You must be signed in to change notification settings - Fork 594
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
feat(vault): support for multiple general purpose credential paths #4360
Conversation
383e7d3
to
2a0f6cd
Compare
6262947
to
0118818
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.
I like the solution, and I checked that the original implementation with vaultCredentialPath
(and vaultTestCredentialPath
) as a string keeps working, but using multiple paths outputs Not fetching credentials from vault since they are not (properly) configured
for me.
0118818
to
599f1f6
Compare
599f1f6
to
6a527ab
Compare
/it-go |
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.
It's working well now!
// Test empty and non-empty custom general purpose credential prefix | ||
envPrefixes := []string{"CUSTOM_MYCRED1_", ""} | ||
for idx, envPrefix := range envPrefixes { | ||
tEnvPrefix := envPrefix |
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.
What does tEnvPrefix
do, compared to just using envPrefix
?
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.
envPrefix is passed to t.Run() but it is running in parallel using t.Parallel(), so envPrefix is mutated on each iteration leaving us with a bug, the value of envPrefix will be the last element of envPrefixes. So in order to avoid it, we can just create a variable on each iteration and pass it to t.Run() which is running in parallel.
cde154f
to
1e5c36f
Compare
/it-go |
1 similar comment
/it-go |
Kudos, SonarCloud Quality Gate passed! |
/it-go |
…AP#4360) * created wrapper * tests added * update documentation * tests data race fix --------- Co-authored-by: Jordi van Liempt <[email protected]>
Changes
Created a wrapper for an existing function to support multiple iterations of fetching secrets from the vault.