Update vault ca provider namespace configuration#19095
Conversation
There was a problem hiding this comment.
This check here isn't strictly necessary but it does duplicate the problem reported in the issue where the provider fails to initialize because the namespace doesn't exist.
agent/connect/ca/testing.go
Outdated
There was a problem hiding this comment.
Maybe this mechanism is overkill but it would allow us to have other tests be discriminant about what Vault features are available to test with. For example, we could skip tests for certain Vault versions if the feature isn't applicable. Maybe this falls in the category of YNGNI, but it was super easy to implement it this way, so I did.
agent/connect/ca/testing.go
Outdated
There was a problem hiding this comment.
Just cleaning up code flagged by go-static-check. "Yoda" statements, like it does not.
434524e to
d4cff3b
Compare
kisunji
left a comment
There was a problem hiding this comment.
Looks great! Thanks for the thorough integration testing
d4cff3b to
c55f1a4
Compare
c55f1a4 to
c721f5c
Compare
c721f5c to
8868f67
Compare
Description
This PR fixes the regression described in #19051. The Vault CA provider has been updated to only set the namespace on the Vault client if it is not empty, otherwise it falls back to the base namespace configured for the provider.
Testing & Reproduction steps
A new unit test
TestVaultCAProvider_EnterpriseNamespacehas been created to exercise the update. This requires a local Vault Enterprise binary and license to run, otherwise the test will automatically be skipped.PR Checklist
external facing docs updated