Discard errors from rkt status and cat-manifest

Since we don't actually show these errors anywhere, just discard them
right away.
This commit is contained in:
Lasse Dalegaard 2017-09-26 09:00:35 +02:00
parent cbcbe0da2e
commit 2d307d5beb
1 changed files with 5 additions and 4 deletions

View File

@ -5,6 +5,7 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net"
"os"
@ -121,10 +122,10 @@ func rktGetStatus(uuid string) (*rktv1.Pod, error) {
"--format=json",
uuid,
}
var outBuf, errBuf bytes.Buffer
var outBuf bytes.Buffer
cmd := exec.Command(rktCmd, statusArgs...)
cmd.Stdout = &outBuf
cmd.Stderr = &errBuf
cmd.Stderr = ioutil.Discard
if err := cmd.Run(); err != nil {
return nil, err
}
@ -141,10 +142,10 @@ func rktGetManifest(uuid string) (*appcschema.PodManifest, error) {
"cat-manifest",
uuid,
}
var outBuf, errBuf bytes.Buffer
var outBuf bytes.Buffer
cmd := exec.Command(rktCmd, statusArgs...)
cmd.Stdout = &outBuf
cmd.Stderr = &errBuf
cmd.Stderr = ioutil.Discard
if err := cmd.Run(); err != nil {
return nil, err
}