Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 57ba688

Browse files
committed
Ijc Nits
Signed-off-by: Simon Ferquel <[email protected]>
1 parent c97d296 commit 57ba688

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

cmd/docker-app/cnab.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ func resolveBundle(dockerCli command.Cli, name string, pullRef bool, insecureReg
149149
if kind == nameKindDir {
150150
return nil, errors.Errorf("%s: cannot pull when referencing a directory based app", name)
151151
}
152-
// XXX perhaps getAppNameKind could do the call to findApp?
153152
return nil, errors.Errorf("cannot pull when referencing a directory based app")
154153
}
155154
return extractAndLoadAppBasedBundle(dockerCli, name)

cmd/docker-app/push.go

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import (
77
"io"
88
"io/ioutil"
99
"os"
10+
"strings"
1011

12+
"github.com/containerd/containerd/platforms"
1113
"github.com/deislabs/duffle/pkg/bundle"
1214
"github.com/docker/app/internal/packager"
1315
"github.com/docker/app/types/metadata"
@@ -88,7 +90,7 @@ func runPush(dockerCli command.Cli, name string, opts pushOptions) error {
8890
}
8991

9092
resolverConfig := remotes.NewResolverConfigFromDockerConfigFile(dockerCli.ConfigFile(), opts.registry.insecureRegistries...)
91-
var display fixupDisplay = &resumeDisplay{out: os.Stdout}
93+
var display fixupDisplay = &plainDisplay{out: os.Stdout}
9294
if term.IsTerminal(os.Stdout.Fd()) {
9395
display = &interactiveDisplay{out: os.Stdout}
9496
}
@@ -219,15 +221,10 @@ func (s *interactiveImageState) print(out io.Writer) int {
219221
}
220222

221223
func printDescriptorProgress(out io.Writer, p *remotes.DescriptorProgressSnapshot, depth int) int {
222-
for i := 0; i < depth; i++ {
223-
fmt.Fprint(out, " ")
224-
}
224+
fmt.Fprint(out, strings.Repeat(" ", depth))
225225
name := p.MediaType
226226
if p.Platform != nil {
227-
name = fmt.Sprintf("%s/%s", p.Platform.OS, p.Platform.Architecture)
228-
if p.Platform.Variant != "" {
229-
name += "/" + p.Platform.Variant
230-
}
227+
name = platforms.Format(*p.Platform)
231228
}
232229
if len(p.Children) == 0 {
233230
name = fmt.Sprintf("%s...: %s", p.Digest.String()[:15], p.Action)
@@ -271,11 +268,11 @@ func hasError(p *remotes.DescriptorProgressSnapshot) bool {
271268
return false
272269
}
273270

274-
type resumeDisplay struct {
271+
type plainDisplay struct {
275272
out io.Writer
276273
}
277274

278-
func (r *resumeDisplay) onEvent(ev remotes.FixupEvent) {
275+
func (r *plainDisplay) onEvent(ev remotes.FixupEvent) {
279276
switch ev.EventType {
280277
case remotes.FixupEventTypeCopyImageStart:
281278
fmt.Fprintf(r.out, "Handling image %s...", ev.SourceImage)

0 commit comments

Comments
 (0)