Skip to content

Commit

Permalink
Remove invalid log "Failed to executing diff command: exit status 1"
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf committed Aug 8, 2019
1 parent 7ecb6dc commit 171da63
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/ingress/controller/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 171da63

Please sign in to comment.