mirror of
https://github.com/containers/buildah.git
synced 2025-07-30 04:23:09 +03:00
Report pull/commit progress by default
Have 'from', 'commit', and 'build-using-dockerfile' report progress via stderr (so that capturing output from 'from' and 'commit' still works as expected) unless --quiet is used to suppress the reporting. Closes #94. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com> Closes: #98 Approved by: rhatdan
This commit is contained in:
committed by
Atomic Bot
parent
6d03588e83
commit
12e582ee1a
@ -2,6 +2,7 @@ package buildah
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/containers/image/copy"
|
||||
"github.com/containers/image/docker/reference"
|
||||
@ -27,6 +28,9 @@ type CommitOptions struct {
|
||||
// the transport to which we're writing the image gives us a way to add
|
||||
// them.
|
||||
AdditionalTags []string
|
||||
// ReportWriter is an io.Writer which will be used to log the writing
|
||||
// of the new image.
|
||||
ReportWriter io.Writer
|
||||
}
|
||||
|
||||
func expandTags(tags []string) ([]string, error) {
|
||||
@ -62,7 +66,7 @@ func (b *Builder) Commit(dest types.ImageReference, options CommitOptions) error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = copy.Image(policyContext, dest, src, getCopyOptions())
|
||||
err = copy.Image(policyContext, dest, src, getCopyOptions(options.ReportWriter))
|
||||
switch dest.Transport().Name() {
|
||||
case storage.Transport.Name():
|
||||
tags, err := expandTags(options.AdditionalTags)
|
||||
|
Reference in New Issue
Block a user