diff options
Diffstat (limited to 'pkg/api/handlers/types.go')
-rw-r--r-- | pkg/api/handlers/types.go | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/pkg/api/handlers/types.go b/pkg/api/handlers/types.go index 588758b2c..3b821d9e7 100644 --- a/pkg/api/handlers/types.go +++ b/pkg/api/handlers/types.go @@ -184,46 +184,6 @@ type ExecStartConfig struct { Width uint16 `json:"w"` } -func ImageToImageSummary(l *libimage.Image) (*entities.ImageSummary, error) { - options := &libimage.InspectOptions{WithParent: true, WithSize: true} - imageData, err := l.Inspect(context.TODO(), options) - if err != nil { - return nil, errors.Wrapf(err, "failed to obtain summary for image %s", l.ID()) - } - - containers, err := l.Containers() - if err != nil { - return nil, errors.Wrapf(err, "failed to obtain Containers for image %s", l.ID()) - } - containerCount := len(containers) - - isDangling, err := l.IsDangling(context.TODO()) - if err != nil { - return nil, errors.Wrapf(err, "failed to check if image %s is dangling", l.ID()) - } - - is := entities.ImageSummary{ - // docker adds sha256: in front of the ID - ID: "sha256:" + l.ID(), - ParentId: imageData.Parent, - RepoTags: imageData.RepoTags, - RepoDigests: imageData.RepoDigests, - Created: l.Created().Unix(), - Size: imageData.Size, - SharedSize: 0, - VirtualSize: imageData.VirtualSize, - Labels: imageData.Labels, - Containers: containerCount, - ReadOnly: l.IsReadOnly(), - Dangling: isDangling, - Names: l.Names(), - Digest: string(imageData.Digest), - ConfigDigest: "", // TODO: libpod/image didn't set it but libimage should - History: imageData.NamesHistory, - } - return &is, nil -} - func ImageDataToImageInspect(ctx context.Context, l *libimage.Image) (*ImageInspect, error) { options := &libimage.InspectOptions{WithParent: true, WithSize: true} info, err := l.Inspect(context.Background(), options) |