Remove invalid log "Failed to executing diff command: exit status 1"

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-08-08 12:53:23 -04:00
parent 7ecb6dc447
commit 171da635ef
No known key found for this signature in database
GPG key ID: 786136016A8BA02A

View file

@ -698,7 +698,12 @@ func (n *NGINXController) OnUpdate(ingressCfg ingress.Configuration) error {
diffOutput, err := exec.Command("diff", "-u", cfgPath, tmpfile.Name()).CombinedOutput()
if err != nil {
klog.Warningf("Failed to executing diff command: %v", err)
if exitError, ok := err.(*exec.ExitError); ok {
ws := exitError.Sys().(syscall.WaitStatus)
if ws.ExitStatus() == 2 {
klog.Warningf("Failed to executing diff command: %v", err)
}
}
}
klog.Infof("NGINX configuration diff:\n%v", string(diffOutput))