feat(vault/kubernetes): allow configurable token path#1016
Conversation
dfef2a7 to
0b6caf5
Compare
There was a problem hiding this comment.
Pull request overview
Adds support for specifying a custom Kubernetes JWT token file path when using Vault Kubernetes authentication, enabling projected service account tokens (e.g., with custom audiences) to be used with vals.
Changes:
- Allow overriding the default Kubernetes service account token file path via
VAULT_KUBERNETES_JWT_TOKEN_PATH. - Improve Vault Kubernetes auth token file error messages to include the path being accessed.
- Document the new environment variable in the Vault authentication section of the README.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/providers/vault/vault.go | Adds env-var override for Kubernetes JWT token path and improves related error handling/messages. |
| README.md | Documents VAULT_KUBERNETES_JWT_TOKEN_PATH for Vault Kubernetes auth. |
|
@pgdagenais please fix CI issue. |
Signed-off-by: pdagenais2 <[email protected]>
Signed-off-by: pdagenais2 <[email protected]>
Signed-off-by: pdagenais2 <[email protected]>
d456fa4 to
078c7e1
Compare
|
@yxxhero fixed! Please tell me if there is anything else that should be done. Thanks! |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
pkg/providers/vault/vault.go:285
- Variable name
mount_pointuses snake_case instead of Go's conventional camelCase. Rename tomountPointfor consistency with Go naming conventions.
mount_point := os.Getenv("VAULT_KUBERNETES_MOUNT_POINT")
|
@pgdagenais please fix lint issue. |
Signed-off-by: pdagenais2 <[email protected]>
|
@yxxhero I think this should fix the linting issues, very weird since locally I wasn't able to reproduce even tho I was using the same version than your CI. Not sure why this was triggered by my changes even tho it comes from another provider. |
@pgdagenais thanks so much. |
While trying to use the Kubernetes auth with a Token using Audience I wasn't able to use a custom path for my token.
This merge request allow the user to specify an environment variable to do so.
Thanks!