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

add "command" annotation for executing after secret template is rendered #57

Merged
merged 2 commits into from
Feb 20, 2020

Conversation

joemiller
Copy link
Contributor

@joemiller joemiller commented Jan 23, 2020

Addresses #56

This PR adds a new annotation:

  • vault.hashicorp.com/agent-inject-command-

This annotation similar to the one used for customizing the secret template. The specified command will be run by vault-agent after the secret is rendered.

Unaddressed by this PR is that in many cases the vault agent will be running as a different user than the main app container. Thus, the example use case from #56 is not yet fully possible since the call to pkill will be run as a different user/uid than the nginx container.

It may be desirable to allow an annotation that will set the UID of the vault agent container to address this.

EDIT: support for specifying the userid/groupid of the vault agent sidecar is addressed in #60

@hashicorp-cla
Copy link

hashicorp-cla commented Jan 23, 2020

CLA assistant check
All committers have signed the CLA.

@jasonodonnell
Copy link
Contributor

Hi @joemiller, my apologies for the delay. I'm ready to review this PR. Can you resolve the conflicts in the meantime? Thanks!

@joemiller
Copy link
Contributor Author

Will do. I’m traveling so it may be a few days

@joemiller joemiller force-pushed the master branch 2 times, most recently from 2048e72 to fa1cea6 Compare February 20, 2020 15:06
@joemiller
Copy link
Contributor Author

@jasonodonnell conflicts resolved. The conflict in annotations_test.go was a bit of a challenge to resolve but I believe it's in the correct state now. Please advise if I missed something there. thanks!

@@ -70,6 +70,7 @@ type Template struct {
Contents string `json:"contents"`
LeftDelim string `json:"left_delimiter,omitempty"`
RightDelim string `json:"right_delimiter,omitempty"`
Command string `json:"command",omitempty`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The closing quote needs to be at the end of the line before the tick.

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.

Two minors things but it tested well and code looks fine. I will merge this after they're resolved. Thanks for the contribution!

@jasonodonnell jasonodonnell added this to the 0.3.0 milestone Feb 20, 2020
@joemiller
Copy link
Contributor Author

@jasonodonnell great eye! thanks. Fixed, pushed

@jasonodonnell jasonodonnell merged commit 89bf689 into hashicorp:master Feb 20, 2020
@sbeaulie
Copy link
Contributor

Are you planning to get a release for this soon?

@Shaeli
Copy link

Shaeli commented Mar 4, 2020

Hello,
Any news on when this will be released?
Thanks

@jasonodonnell jasonodonnell mentioned this pull request Mar 4, 2020
@tvoran
Copy link
Member

tvoran commented Mar 4, 2020

@Shaeli @sbeaulie It should go out this week, in #99

@joemiller
Copy link
Contributor Author

joemiller commented Mar 4, 2020 via email

RemcoBuddelmeijer pushed a commit to RemcoBuddelmeijer/vault-k8s that referenced this pull request Feb 22, 2022
…red (hashicorp#57)

* remove trailing whitespace

* add command annotation for configuring a command to execute after secret rendering
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.

6 participants