Skip to content

Commit

Permalink
Merge pull request #4416 from aledbf/diff
Browse files Browse the repository at this point in the history
Remove invalid log "Failed to executing diff command: exit status 1"
  • Loading branch information
k8s-ci-robot authored Aug 8, 2019
2 parents 34593c0 + 171da63 commit f467876
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 f467876

Please sign in to comment.