Skip to content
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

Merged
merged 8 commits into from
Dec 7, 2020

Conversation

hpio
Copy link
Contributor

@hpio hpio commented Nov 19, 2020

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 or extraEnvironmentVars.
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.

@hashicorp-cla
Copy link

hashicorp-cla commented Nov 19, 2020

CLA assistant check
All committers have signed the CLA.

@jasonodonnell jasonodonnell self-requested a review November 24, 2020 16:41
Copy link
Contributor

@jasonodonnell jasonodonnell left a 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.

@hpio
Copy link
Contributor Author

hpio commented Nov 25, 2020

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 root for a long period of time as I only recently started using Vault.

@@ -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" }}
Copy link
Contributor

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"
Copy link
Contributor

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.

Copy link
Contributor

@jasonodonnell jasonodonnell left a 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.

@hpio
Copy link
Contributor Author

hpio commented Nov 26, 2020

hey @jasonodonnell , hopefully latest changes are enough. Thanks for your help

@jasonodonnell
Copy link
Contributor

Changes look good @hpio at a glance. When I return next week I will give them a test and merge. Thanks!

@jasonodonnell jasonodonnell self-requested a review November 30, 2020 21:32
@jasonodonnell jasonodonnell merged commit e2b6098 into hashicorp:master Dec 7, 2020
@jasonodonnell
Copy link
Contributor

Thanks @hpio!

@hpio hpio deleted the fix-vault-dev-root-token-id branch January 4, 2021 15:08
@tvoran tvoran mentioned this pull request Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants