vendor template

This commit is contained in:
Alex Dadgar 2017-08-29 16:57:40 -07:00
parent 7b0f46d1cb
commit 6aaffa30f0
3 changed files with 51 additions and 45 deletions

View File

@ -249,12 +249,16 @@ func (r *Runner) Start() {
} }
if r.allTemplatesRendered() { if r.allTemplatesRendered() {
log.Printf("[DEBUG] (runner) all templates rendered")
// If an exec command was given and a command is not currently running, // If an exec command was given and a command is not currently running,
// spawn the child process for supervision. // spawn the child process for supervision.
if config.StringPresent(r.config.Exec.Command) { if config.StringPresent(r.config.Exec.Command) {
// Lock the child because we are about to check if it exists. // Lock the child because we are about to check if it exists.
r.childLock.Lock() r.childLock.Lock()
log.Printf("[TRACE] (runner) acquired child lock for command, spawning")
if r.child == nil { if r.child == nil {
env := r.config.Exec.Env.Copy() env := r.config.Exec.Env.Copy()
env.Custom = append(r.childEnv(), env.Custom...) env.Custom = append(r.childEnv(), env.Custom...)
@ -946,7 +950,8 @@ func (r *Runner) allTemplatesRendered() bool {
defer r.renderEventsLock.RUnlock() defer r.renderEventsLock.RUnlock()
for _, tmpl := range r.templates { for _, tmpl := range r.templates {
if _, rendered := r.renderEvents[tmpl.ID()]; !rendered { event, rendered := r.renderEvents[tmpl.ID()]
if !rendered || !event.DidRender {
return false return false
} }
} }

View File

@ -8,32 +8,33 @@ import (
) )
var SignalLookup = map[string]os.Signal{ var SignalLookup = map[string]os.Signal{
"SIGABRT": syscall.SIGABRT, "SIGABRT": syscall.SIGABRT,
"SIGALRM": syscall.SIGALRM, "SIGALRM": syscall.SIGALRM,
"SIGBUS": syscall.SIGBUS, "SIGBUS": syscall.SIGBUS,
"SIGCHLD": syscall.SIGCHLD, "SIGCHLD": syscall.SIGCHLD,
"SIGCONT": syscall.SIGCONT, "SIGCONT": syscall.SIGCONT,
"SIGFPE": syscall.SIGFPE, "SIGFPE": syscall.SIGFPE,
"SIGHUP": syscall.SIGHUP, "SIGHUP": syscall.SIGHUP,
"SIGILL": syscall.SIGILL, "SIGILL": syscall.SIGILL,
"SIGINT": syscall.SIGINT, "SIGINT": syscall.SIGINT,
"SIGIO": syscall.SIGIO, "SIGIO": syscall.SIGIO,
"SIGIOT": syscall.SIGIOT, "SIGIOT": syscall.SIGIOT,
"SIGKILL": syscall.SIGKILL, "SIGKILL": syscall.SIGKILL,
"SIGPIPE": syscall.SIGPIPE, "SIGPIPE": syscall.SIGPIPE,
"SIGPROF": syscall.SIGPROF, "SIGPROF": syscall.SIGPROF,
"SIGQUIT": syscall.SIGQUIT, "SIGQUIT": syscall.SIGQUIT,
"SIGSEGV": syscall.SIGSEGV, "SIGSEGV": syscall.SIGSEGV,
"SIGSTOP": syscall.SIGSTOP, "SIGSTOP": syscall.SIGSTOP,
"SIGSYS": syscall.SIGSYS, "SIGSYS": syscall.SIGSYS,
"SIGTERM": syscall.SIGTERM, "SIGTERM": syscall.SIGTERM,
"SIGTRAP": syscall.SIGTRAP, "SIGTRAP": syscall.SIGTRAP,
"SIGTSTP": syscall.SIGTSTP, "SIGTSTP": syscall.SIGTSTP,
"SIGTTIN": syscall.SIGTTIN, "SIGTTIN": syscall.SIGTTIN,
"SIGTTOU": syscall.SIGTTOU, "SIGTTOU": syscall.SIGTTOU,
"SIGURG": syscall.SIGURG, "SIGURG": syscall.SIGURG,
"SIGUSR1": syscall.SIGUSR1, "SIGUSR1": syscall.SIGUSR1,
"SIGUSR2": syscall.SIGUSR2, "SIGUSR2": syscall.SIGUSR2,
"SIGXCPU": syscall.SIGXCPU, "SIGWINCH": syscall.SIGWINCH,
"SIGXFSZ": syscall.SIGXFSZ, "SIGXCPU": syscall.SIGXCPU,
"SIGXFSZ": syscall.SIGXFSZ,
} }

32
vendor/vendor.json vendored
View File

@ -611,44 +611,44 @@
{ {
"checksumSHA1": "Nu2j1GusM7ZH0uYrGzqr1K7yH7I=", "checksumSHA1": "Nu2j1GusM7ZH0uYrGzqr1K7yH7I=",
"path": "github.com/hashicorp/consul-template/child", "path": "github.com/hashicorp/consul-template/child",
"revision": "7b3f45039cf3ad1a758683fd3eebb1cc72affa06", "revision": "a6369e8e105f2f5534671e2609dc19e20b55da96",
"revisionTime": "2017-08-01T00:58:49Z" "revisionTime": "2017-08-25T23:40:39Z"
}, },
{ {
"checksumSHA1": "lemUzh6uQDMxuvTT/BREYdGcS0U=", "checksumSHA1": "lemUzh6uQDMxuvTT/BREYdGcS0U=",
"path": "github.com/hashicorp/consul-template/config", "path": "github.com/hashicorp/consul-template/config",
"revision": "7b3f45039cf3ad1a758683fd3eebb1cc72affa06", "revision": "a6369e8e105f2f5534671e2609dc19e20b55da96",
"revisionTime": "2017-08-01T00:58:49Z" "revisionTime": "2017-08-25T23:40:39Z"
}, },
{ {
"checksumSHA1": "WVZ+pqn/HLLXjj+Tj5ZZvD7w6r0=", "checksumSHA1": "WVZ+pqn/HLLXjj+Tj5ZZvD7w6r0=",
"path": "github.com/hashicorp/consul-template/dependency", "path": "github.com/hashicorp/consul-template/dependency",
"revision": "7b3f45039cf3ad1a758683fd3eebb1cc72affa06", "revision": "a6369e8e105f2f5534671e2609dc19e20b55da96",
"revisionTime": "2017-08-01T00:58:49Z" "revisionTime": "2017-08-25T23:40:39Z"
}, },
{ {
"checksumSHA1": "tkMwyjIrH+reCJWIg45lvcmkhVQ=", "checksumSHA1": "ZuqKmrZAWgHbWGGt1e9RAMZ4wvs=",
"path": "github.com/hashicorp/consul-template/manager", "path": "github.com/hashicorp/consul-template/manager",
"revision": "252f61dede55b1009323aae8b0ffcd2e2e933173", "revision": "a6369e8e105f2f5534671e2609dc19e20b55da96",
"revisionTime": "2017-08-09T17:59:55Z" "revisionTime": "2017-08-25T23:40:39Z"
}, },
{ {
"checksumSHA1": "oskgb0WteBKOItG8NNDduM7E/D0=", "checksumSHA1": "YSEUV/9/k85XciRKu0cngxdjZLE=",
"path": "github.com/hashicorp/consul-template/signals", "path": "github.com/hashicorp/consul-template/signals",
"revision": "7b3f45039cf3ad1a758683fd3eebb1cc72affa06", "revision": "a6369e8e105f2f5534671e2609dc19e20b55da96",
"revisionTime": "2017-08-01T00:58:49Z" "revisionTime": "2017-08-25T23:40:39Z"
}, },
{ {
"checksumSHA1": "zSvJlNfZS3fCRlFaZ7r9Q+N17T8=", "checksumSHA1": "zSvJlNfZS3fCRlFaZ7r9Q+N17T8=",
"path": "github.com/hashicorp/consul-template/template", "path": "github.com/hashicorp/consul-template/template",
"revision": "7b3f45039cf3ad1a758683fd3eebb1cc72affa06", "revision": "a6369e8e105f2f5534671e2609dc19e20b55da96",
"revisionTime": "2017-08-01T00:58:49Z" "revisionTime": "2017-08-25T23:40:39Z"
}, },
{ {
"checksumSHA1": "b4+Y+02pY2Y5620F9ALzKg8Zmdw=", "checksumSHA1": "b4+Y+02pY2Y5620F9ALzKg8Zmdw=",
"path": "github.com/hashicorp/consul-template/watch", "path": "github.com/hashicorp/consul-template/watch",
"revision": "7b3f45039cf3ad1a758683fd3eebb1cc72affa06", "revision": "a6369e8e105f2f5534671e2609dc19e20b55da96",
"revisionTime": "2017-08-01T00:58:49Z" "revisionTime": "2017-08-25T23:40:39Z"
}, },
{ {
"checksumSHA1": "jfELEMRhiTcppZmRH+ZwtkVS5Uw=", "checksumSHA1": "jfELEMRhiTcppZmRH+ZwtkVS5Uw=",