Make --quiet work in podman create/run

The --queit option is supposed to suppress the pulling messages
when a new image is being pulled down.

This patch fixes this issue.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2019-01-29 16:10:51 +00:00
parent ebe929736c
commit 097b0eaa9a

View File

@ -4,6 +4,7 @@ import (
"context" "context"
"encoding/json" "encoding/json"
"fmt" "fmt"
"io"
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
@ -128,7 +129,12 @@ func createContainer(c *cli.Context, runtime *libpod.Runtime) (*libpod.Container
var data *inspect.ImageData = nil var data *inspect.ImageData = nil
if rootfs == "" && !rootless.SkipStorageSetup() { if rootfs == "" && !rootless.SkipStorageSetup() {
newImage, err := runtime.ImageRuntime().New(ctx, c.Args()[0], rtc.SignaturePolicyPath, "", os.Stderr, nil, image.SigningOptions{}, false) var writer io.Writer
if !c.Bool("quiet") {
writer = os.Stderr
}
newImage, err := runtime.ImageRuntime().New(ctx, c.Args()[0], rtc.SignaturePolicyPath, "", writer, nil, image.SigningOptions{}, false)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }