9
9
"os"
10
10
"strings"
11
11
12
+ "github.com/containerd/containerd/log"
12
13
"github.com/containerd/containerd/platforms"
13
14
"github.com/deislabs/cnab-go/bundle"
14
15
"github.com/docker/app/types/metadata"
@@ -23,6 +24,7 @@ import (
23
24
"github.com/morikuni/aec"
24
25
ocischemav1 "github.com/opencontainers/image-spec/specs-go/v1"
25
26
"github.com/pkg/errors"
27
+ "github.com/sirupsen/logrus"
26
28
"github.com/spf13/cobra"
27
29
"github.com/spf13/pflag"
28
30
)
@@ -133,14 +135,21 @@ func runPush(dockerCli command.Cli, name string, opts pushOptions) error {
133
135
return errors .Wrapf (err , "fixing up %q for push" , retag .cnabRef )
134
136
}
135
137
// 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 )
137
139
if err != nil {
138
140
return errors .Wrapf (err , "pushing to %q" , retag .cnabRef )
139
141
}
140
142
fmt .Fprintf (os .Stdout , "Successfully pushed bundle to %s. Digest is %s.\n " , retag .cnabRef .String (), descriptor .Digest )
141
143
return nil
142
144
}
143
145
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
+
144
153
func withAppAnnotations (index * ocischemav1.Index ) error {
145
154
if index .Annotations == nil {
146
155
index .Annotations = make (map [string ]string )
0 commit comments