(ctx context.Context, containers []containerd.Container)
| 104 | } |
| 105 | |
| 106 | func printComposeImageIDs(ctx context.Context, containers []containerd.Container) error { |
| 107 | ids := []string{} |
| 108 | for _, c := range containers { |
| 109 | image, err := c.Image(ctx) |
| 110 | if err != nil { |
| 111 | return err |
| 112 | } |
| 113 | metaImage := image.Metadata() |
| 114 | id := metaImage.Target.Digest.String() |
| 115 | if !strutil.InStringSlice(ids, id) { |
| 116 | ids = append(ids, id) |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | for _, id := range ids { |
| 121 | // always truncate image ids. |
| 122 | fmt.Println(strings.Split(id, ":")[1][:12]) |
| 123 | } |
| 124 | return nil |
| 125 | } |
| 126 | |
| 127 | func printComposeImages(ctx context.Context, cmd *cobra.Command, containers []containerd.Container, sn snapshots.Snapshotter, format string) error { |
| 128 | type composeImagePrintable struct { |
no test coverage detected
searching dependent graphs…