-
Notifications
You must be signed in to change notification settings - Fork 894
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
don't set VAULT_DEV_ROOT_TOKEN_ID by default in dev mode #415
don't set VAULT_DEV_ROOT_TOKEN_ID by default in dev mode #415
Conversation
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.
Hi @hpio, thanks for the contribution!
I think it might be better to just make a config under the server.dev
settings that allow you to override the default token. This has been set to root
since we've 0.1.0 so changing this behavior now isn't desirable since users could be relying on it for CI/testing purposes.
Definitely agree that the static value should be configurable so server.dev.devRootToken
with a default value of root
would be the way to go.
Hope that helps.
thanks for the feedback @jasonodonnell . I made suggested changes and hopefully everything's good this time. I was not aware that token has been set to |
templates/_helpers.tpl
Outdated
@@ -140,7 +140,7 @@ Set's additional environment variables based on the mode. | |||
{{- define "vault.envs" -}} | |||
{{ if eq .mode "dev" }} | |||
- name: VAULT_DEV_ROOT_TOKEN_ID | |||
value: "root" | |||
value: {{ .Values.server.dev.devRootToken | default "root" }} |
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.
Instead of having default "root"
here, set this in the values.yaml
file and have it uncommented. We've been moving away from backend defaults to be more transparent in the values.yaml
file.
values.yaml
Outdated
@@ -417,6 +417,9 @@ server: | |||
dev: | |||
enabled: false | |||
|
|||
# Overrides dev root token value which by default is set to "root" | |||
#devRootToken: "root" |
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.
Uncomment as per previous comment.
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.
Small tweaks but looks good!
Additionally unit tests will need to be added for coverage on the configurable. Two simple tests demonstrating the default value is root
and that it changes when configured would suffice.
Let me know if you have any questions.
…d set uncomment devRootToken in values.yaml
hey @jasonodonnell , hopefully latest changes are enough. Thanks for your help |
Changes look good @hpio at a glance. When I return next week I will give them a test and merge. Thanks! |
Thanks @hpio! |
Do not set VAULT_DEV_ROOT_TOKEN_ID environment variable by default when running in dev mode as it can already be set using
extraSecretEnvironmentVars
orextraEnvironmentVars
.At the moment it is impossible to set VAULT_DEV_ROOT_TOKEN_ID to a custome value as variable will be duplicated in a resulting yaml file.