From 171da635efda3c8917e923ca7ab32beb8b46bb72 Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Thu, 8 Aug 2019 12:53:23 -0400 Subject: [PATCH] Remove invalid log "Failed to executing diff command: exit status 1" --- internal/ingress/controller/nginx.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/ingress/controller/nginx.go b/internal/ingress/controller/nginx.go index f9b1899443..6aacb4b4d2 100644 --- a/internal/ingress/controller/nginx.go +++ b/internal/ingress/controller/nginx.go @@ -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))