MCPcopy Index your code
hub / github.com/docker/cli / imageFormat

Function imageFormat

cli/command/formatter/image.go:89–110  ·  view source on GitHub ↗
(ctx ImageContext, images []image.Summary, format func(subContext SubContext) error)

Source from the content-addressed store, hash-verified

87}
88
89func imageFormat(ctx ImageContext, images []image.Summary, format func(subContext SubContext) error) error {
90 for _, img := range images {
91 formatted := []*imageContext{}
92 if isDangling(img) {
93 formatted = append(formatted, &imageContext{
94 trunc: ctx.Trunc,
95 i: img,
96 repo: "<none>",
97 tag: "<none>",
98 digest: "<none>",
99 })
100 } else {
101 formatted = imageFormatTaggedAndDigest(ctx, img)
102 }
103 for _, imageCtx := range formatted {
104 if err := format(imageCtx); err != nil {
105 return err
106 }
107 }
108 }
109 return nil
110}
111
112func imageFormatTaggedAndDigest(ctx ImageContext, img image.Summary) []*imageContext {
113 repoTags := map[string][]string{}

Callers 1

ImageWriteFunction · 0.85

Calls 3

formatFunction · 0.85
isDanglingFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…