Skip to content

Commit

Permalink
Merge pull request #615 from aledbf/avoid-wait
Browse files Browse the repository at this point in the history
Process exited cleanly before we hit wait4
  • Loading branch information
aledbf authored Apr 17, 2017
2 parents fc67b1d + aba45a0 commit 7f37635
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions controllers/nginx/pkg/template/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (
const (
slash = "/"
defBufferSize = 65535
errNoChild = "wait: no child processes"
)

// Template ...
Expand Down Expand Up @@ -100,7 +101,7 @@ func (t *Template) Write(conf config.TemplateConfig) ([]byte, error) {
}

err := t.tmpl.Execute(t.tmplBuf, conf)
if err != nil {
if err != nil && err.Error() != errNoChild {
return nil, err
}

Expand All @@ -110,7 +111,10 @@ func (t *Template) Write(conf config.TemplateConfig) ([]byte, error) {
cmd.Stdin = t.tmplBuf
cmd.Stdout = t.outCmdBuf
if err := cmd.Run(); err != nil {
glog.Warningf("unexpected error cleaning template: %v", err)
if err.Error() != errNoChild {
glog.Warningf("unexpected error cleaning template: %v", err)
}

return t.tmplBuf.Bytes(), nil
}

Expand Down

0 comments on commit 7f37635

Please sign in to comment.