@@ -129,8 +129,7 @@ var _ = Describe("GitOpsServiceController", func() {
129129 ocPath , err := exec .LookPath ("oc" )
130130 Expect (err ).NotTo (HaveOccurred ())
131131
132- cmd := exec .Command (ocPath , "apply" , "-f" , imageYAML )
133- err = cmd .Run ()
132+ _ , _ , err = runCommandWithOutput (ocPath , "apply" , "-f" , imageYAML )
134133 Expect (err ).NotTo (HaveOccurred ())
135134 })
136135
@@ -191,8 +190,7 @@ var _ = Describe("GitOpsServiceController", func() {
191190 nonDefaultAppCR := filepath .Join (".." , "appcrs" , "non_default_appcr.yaml" )
192191 ocPath , err := exec .LookPath ("oc" )
193192 Expect (err ).NotTo (HaveOccurred ())
194- cmd := exec .Command (ocPath , "apply" , "-f" , nonDefaultAppCR )
195- _ , err = cmd .CombinedOutput ()
193+ _ , _ , err = runCommandWithOutput (ocPath , "apply" , "-f" , nonDefaultAppCR )
196194 if err != nil {
197195 Expect (err ).NotTo (HaveOccurred ())
198196 }
@@ -321,8 +319,7 @@ var _ = Describe("GitOpsServiceController", func() {
321319 ocPath , err := exec .LookPath ("oc" )
322320 Expect (err ).NotTo (HaveOccurred ())
323321 schedulerYAML := filepath .Join (".." , "appcrs" , "scheduler_appcr.yaml" )
324- cmd := exec .Command (ocPath , "apply" , "-f" , schedulerYAML )
325- _ , err = cmd .CombinedOutput ()
322+ _ , _ , err = runCommandWithOutput (ocPath , "apply" , "-f" , schedulerYAML )
326323 Expect (err ).NotTo (HaveOccurred ())
327324
328325 Eventually (func () error {
@@ -420,8 +417,7 @@ var _ = Describe("GitOpsServiceController", func() {
420417 nginxAppCr := filepath .Join (".." , "appcrs" , "nginx_appcr.yaml" )
421418 ocPath , err := exec .LookPath ("oc" )
422419 Expect (err ).NotTo (HaveOccurred ())
423- cmd := exec .Command (ocPath , "apply" , "-f" , nginxAppCr )
424- err = cmd .Run ()
420+ _ , _ , err = runCommandWithOutput (ocPath , "apply" , "-f" , nginxAppCr )
425421 Expect (err ).NotTo (HaveOccurred ())
426422
427423 Eventually (func () error {
@@ -487,8 +483,7 @@ var _ = Describe("GitOpsServiceController", func() {
487483 nginxAppCr := filepath .Join (".." , "appcrs" , "nginx_default_ns_appcr.yaml" )
488484 ocPath , err := exec .LookPath ("oc" )
489485 Expect (err ).NotTo (HaveOccurred ())
490- cmd := exec .Command (ocPath , "apply" , "-f" , nginxAppCr )
491- err = cmd .Run ()
486+ _ , _ , err = runCommandWithOutput (ocPath , "apply" , "-f" , nginxAppCr )
492487 Expect (err ).NotTo (HaveOccurred ())
493488
494489 Eventually (func () error {
0 commit comments