From 53411f9ea49e74fd0a05043d2844ccbfed5a9378 Mon Sep 17 00:00:00 2001 From: lbischof Date: Tue, 28 Aug 2018 15:16:35 +0200 Subject: [PATCH] Ignore exit 1 from grep when there are no buildnodes --- daemon/client/checks/openshift.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/client/checks/openshift.go b/daemon/client/checks/openshift.go index 975eb8f..440f4ca 100644 --- a/daemon/client/checks/openshift.go +++ b/daemon/client/checks/openshift.go @@ -77,7 +77,7 @@ func runOcGetNodes(buildNodes bool) (string, error) { if buildNodes { buildNodes_grep_params = "" } - out, err := exec.Command("bash", "-c", fmt.Sprintf("oc get nodes --show-labels | grep -v monitoring=false | grep %s purpose=buildnode | grep -v SchedulingDisabled", buildNodes_grep_params)).Output() + out, err := exec.Command("bash", "-c", fmt.Sprintf("oc get nodes --show-labels | grep -v monitoring=false | grep -v SchedulingDisabled | grep %s purpose=buildnode || test $? -eq 1", buildNodes_grep_params)).Output() if err != nil { msg := "Could not parse oc get nodes output: " + err.Error() log.Println(msg)