Merge pull request #295 from tangle329/master

We need check content, when cmd failed.
This commit is contained in:
Manuel Alejandro de Brito Fontes 2017-02-23 00:28:13 -03:00 committed by GitHub
commit 964aa0a15a
3 changed files with 15 additions and 12 deletions

View file

@ -78,7 +78,7 @@ func (t *Template) Close() {
// Write populates a buffer using a template with NGINX configuration
// and the servers and upstreams created by Ingress rules
func (t *Template) Write(conf config.TemplateConfig, isValidTemplate func([]byte) error) ([]byte, error) {
func (t *Template) Write(conf config.TemplateConfig) ([]byte, error) {
defer t.tmplBuf.Reset()
defer t.outCmdBuf.Reset()
@ -114,13 +114,7 @@ func (t *Template) Write(conf config.TemplateConfig, isValidTemplate func([]byte
return t.tmplBuf.Bytes(), nil
}
content := t.outCmdBuf.Bytes()
err = isValidTemplate(content)
if err != nil {
return nil, err
}
return content, nil
return t.outCmdBuf.Bytes(), nil
}
var (