Auto stash before merge of "master" and "master/master"

Remove go-reap and use tini as process reaper
This commit is contained in:
Manuel de Brito Fontes 2017-05-16 16:06:33 -04:00
parent 8ca5fbeece
commit 22d63d0ad0
4 changed files with 8 additions and 13 deletions

View file

@ -23,14 +23,10 @@ import (
"time"
"github.com/golang/glog"
go_reap "github.com/hashicorp/go-reap"
"k8s.io/ingress/core/pkg/ingress/controller"
)
func main() {
go go_reap.ReapChildren(nil, nil, nil, nil)
// start a new nginx controller
ngx := newNGINXController()
// create a custom Ingress controller using NGINX as backend

View file

@ -53,8 +53,6 @@ const (
defaultStatusModule statusModule = "default"
vtsStatusModule statusModule = "vts"
errNoChild = "wait: no child processes"
)
var (
@ -354,7 +352,7 @@ func (n NGINXController) testTemplate(cfg []byte) error {
return err
}
out, err := exec.Command(n.binary, "-t", "-c", tmpfile.Name()).CombinedOutput()
if err != nil && err.Error() != errNoChild {
if err != nil {
// this error is different from the rest because it must be clear why nginx is not working
oe := fmt.Sprintf(`
-------------------------------------------------------------------------------

View file

@ -40,7 +40,6 @@ import (
const (
slash = "/"
defBufferSize = 65535
errNoChild = "wait: no child processes"
)
// Template ...
@ -102,7 +101,7 @@ func (t *Template) Write(conf config.TemplateConfig) ([]byte, error) {
}
err := t.tmpl.Execute(t.tmplBuf, conf)
if err != nil && err.Error() != errNoChild {
if err != nil {
return nil, err
}
@ -112,10 +111,7 @@ func (t *Template) Write(conf config.TemplateConfig) ([]byte, error) {
cmd.Stdin = t.tmplBuf
cmd.Stdout = t.outCmdBuf
if err := cmd.Run(); err != nil {
if err.Error() != errNoChild {
glog.Warningf("unexpected error cleaning template: %v", err)
}
glog.Warningf("unexpected error cleaning template: %v", err)
return t.tmplBuf.Bytes(), nil
}

View file

@ -19,6 +19,11 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
RUN curl -sSL -o /sbin/tini https://github.com/krallin/tini/releases/download/v0.14.0/tini-amd64 && \
chmod +x /sbin/tini
ENTRYPOINT ["/sbin/tini", "--"]
COPY . /
CMD ["/nginx-ingress-controller"]