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
With "wait" consul-template spawns the child process before rendering the template #1229
Comments
Hey @eikenb, Sure thing. I was using the pre-compiled versions from here: https://releases.hashicorp.com/consul-template Thanks |
To build the master branch you'd need a Go dev setup and then you could run Thinking about it I'm not 100% this is a replication of that issue though. If you have a chance to spend some time on this I think, instead of doing the work to build it yourself, it'd be better if you could try to create a standalone, simple way to replicate the issue. Something I could run locally with minimal setup. If you don't have time for that would you mind adding your template here so I have all the parts involved. It's hard to get a good idea of what's happening without all the setup. Thanks. |
Most obvious fix for this is to not have it setup the wait/quiescence timers until all templates have been rendered once. The most obvious way to do that is to move the quiescence initialization code down a few lines into the existing conditional block, conditional on allTemplateRendered(). I.E. Moving this chunk... consul-template/manager/runner.go Lines 226 to 247 in 4170dc9
To just after here... consul-template/manager/runner.go Lines 257 to 258 in 4170dc9
|
Hold off on initializing wait/quiescence until all templates have been rendered once. This fixes an issue with -exec firing before the template has been rendered and would also make sure templates are rendered for once (if that wasn't already fixed another way). Fixes #1229
@eikenb thanks for taking care of this issue 👍 |
Hold off on initializing wait/quiescence until all templates have been rendered once. This fixes an issue with -exec firing before the template has been rendered when wait/quiescence is set, and it would also make sure templates are rendered for once (if that wasn't already fixed another way). Fixes #1229
Hold off on initializing wait/quiescence until all templates have been rendered once. This fixes an issue with -exec firing before the template has been rendered when wait/quiescence is set, and it would also make sure templates are rendered for once (if that wasn't already fixed another way). Fixes #1229
Consul Template version
consul-template v0.20.0
(The same setup works fine in
consul-template v0.19.5
)Configuration
/etc/consul-template.conf:
Command
Expected behavior
After the wait time, it should render the template and then spawn the child process.
Actual behavior
It spawns the child process before rendering the template (only when you use
wait
in thetemplate
block). It seems that it executes the command in theexec
block and then waits for rendering the template.The text was updated successfully, but these errors were encountered: