1
0
mirror of https://github.com/containers/buildah.git synced 2025-07-30 04:23:09 +03:00

Add Quiet to PullOptions and PushOptions

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Add Quiet to the PullOptions and PushOptions structures.
If set to true output will be in 'quiet' mode.  This
will primarily be used by callers such as OpenShift.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #1302
Approved by: rhatdan
This commit is contained in:
TomSweeneyRedHat
2019-01-23 13:33:09 -05:00
committed by Atomic Bot
parent 4bcddb7cbe
commit f1cec509e0
2 changed files with 14 additions and 0 deletions

View File

@ -101,6 +101,10 @@ type PushOptions struct {
// regenerate from on-disk layers, substituting them in the list of
// blobs to copy whenever possible.
BlobDirectory string
// Quiet is a boolean value that determines if minimal output to
// the user will be displayed, this is best used for logging.
// The default is false.
Quiet bool
}
// Commit writes the contents of the container, along with its updated
@ -228,6 +232,9 @@ func (b *Builder) Commit(ctx context.Context, dest types.ImageReference, options
func Push(ctx context.Context, image string, dest types.ImageReference, options PushOptions) (reference.Canonical, digest.Digest, error) {
systemContext := getSystemContext(options.SystemContext, options.SignaturePolicyPath)
if options.Quiet {
options.ReportWriter = nil // Turns off logging output
}
blocked, err := isReferenceBlocked(dest, systemContext)
if err != nil {
return nil, "", errors.Wrapf(err, "error checking if pushing to registry for %q is blocked", transports.ImageName(dest))