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

feature: Add NAMESPACE (from downward API) to list of environment vars #164

Closed
wants to merge 2 commits into from

Conversation

cyrus-mc
Copy link

@cyrus-mc cyrus-mc commented Aug 6, 2020

For the init and sidecar, add NAMESPACE as an environment variable (obtained from downward API).

@cyrus-mc
Copy link
Author

cyrus-mc commented Aug 6, 2020

In my specific case the namespace is used to denote the environment and this is useful information to have when writing templates.

Outside of my specific use case I think it is just good practice to include this information in all PODs.

@jasonodonnell jasonodonnell self-requested a review August 7, 2020 19:16
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 @cyrus-mc, thanks for the PR!

I see a unit test failing due to the new environment variable:

[~] make test
go test -race ./...
?   	github.com/hashicorp/vault-k8s	[no test files]
ok  	github.com/hashicorp/vault-k8s/agent-inject	2.685s
--- FAIL: TestContainerSidecar (0.00s)
    container_sidecar_test.go:104: wrong number of env vars, got 3, should have been 2
    container_sidecar_test.go:116: env name wrong, should have been VAULT_CONFIG, got NAMESPACE
    container_sidecar_test.go:120: env value empty, it shouldn't be
--- FAIL: TestContainerSidecarConfigMap (0.00s)
    container_sidecar_test.go:254: wrong number of env vars, got 2, should have been 1
FAIL
FAIL	github.com/hashicorp/vault-k8s/agent-inject/agent	2.742s
ok  	github.com/hashicorp/vault-k8s/helper/cert	6.732s
ok  	github.com/hashicorp/vault-k8s/subcommand/injector	1.997s
?   	github.com/hashicorp/vault-k8s/subcommand/version	[no test files]
?   	github.com/hashicorp/vault-k8s/version	[no test files]
FAIL
make: *** [unit-test] Error 1

Would you mind updating this test?

@jasonodonnell
Copy link
Contributor

Bump @cyrus-mc

@hashicorp-cla
Copy link

hashicorp-cla commented Mar 12, 2022

CLA assistant check
All committers have signed the CLA.

@tomhjp
Copy link
Contributor

tomhjp commented Oct 24, 2023

Thanks for the PR! Looks like #486 got merged and has this one covered now.

@tomhjp tomhjp closed this Oct 24, 2023
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.

4 participants