99 "os"
1010 "strings"
1111
12+ "github.com/containerd/containerd/log"
1213 "github.com/containerd/containerd/platforms"
1314 "github.com/deislabs/cnab-go/bundle"
1415 "github.com/docker/app/types/metadata"
@@ -23,6 +24,7 @@ import (
2324 "github.com/morikuni/aec"
2425 ocischemav1 "github.com/opencontainers/image-spec/specs-go/v1"
2526 "github.com/pkg/errors"
27+ "github.com/sirupsen/logrus"
2628 "github.com/spf13/cobra"
2729 "github.com/spf13/pflag"
2830)
@@ -133,14 +135,21 @@ func runPush(dockerCli command.Cli, name string, opts pushOptions) error {
133135 return errors .Wrapf (err , "fixing up %q for push" , retag .cnabRef )
134136 }
135137 // push bundle manifest
136- descriptor , err := remotes .Push (context . Background (), bndl , retag .cnabRef , resolverConfig .Resolver , true , withAppAnnotations )
138+ descriptor , err := remotes .Push (newMuteLogContext (), bndl , retag .cnabRef , resolverConfig .Resolver , true , withAppAnnotations )
137139 if err != nil {
138140 return errors .Wrapf (err , "pushing to %q" , retag .cnabRef )
139141 }
140142 fmt .Fprintf (os .Stdout , "Successfully pushed bundle to %s. Digest is %s.\n " , retag .cnabRef .String (), descriptor .Digest )
141143 return nil
142144}
143145
146+ func newMuteLogContext () context.Context {
147+ logger := logrus .New ()
148+ logger .SetLevel (logrus .ErrorLevel )
149+ logger .SetOutput (ioutil .Discard )
150+ return log .WithLogger (context .Background (), logrus .NewEntry (logger ))
151+ }
152+
144153func withAppAnnotations (index * ocischemav1.Index ) error {
145154 if index .Annotations == nil {
146155 index .Annotations = make (map [string ]string )
0 commit comments