We need check content, when cmd failed.
Signed-off-by: Tang Le <at28997146@163.com>
This commit is contained in:
parent
3d9f89be1d
commit
e26efd0b08
1 changed files with 7 additions and 1 deletions
|
@ -111,7 +111,13 @@ func (t *Template) Write(conf config.TemplateConfig, isValidTemplate func([]byte
|
|||
cmd.Stdout = t.outCmdBuf
|
||||
if err := cmd.Run(); err != nil {
|
||||
glog.Warningf("unexpected error cleaning template: %v", err)
|
||||
return t.tmplBuf.Bytes(), nil
|
||||
content := t.tmplBuf.Bytes()
|
||||
err = isValidTemplate(content)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return content, nil
|
||||
}
|
||||
|
||||
content := t.outCmdBuf.Bytes()
|
||||
|
|
Loading…
Reference in a new issue