summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/types.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-01-15 20:39:16 +0100
committerGitHub <noreply@github.com>2022-01-15 20:39:16 +0100
commit3c9e41bb5393e0a857d8755bb50345544cc31b50 (patch)
tree9f2af691f56081271e7fff6971ddd7e5fe45271a /pkg/api/handlers/types.go
parentfff9e8755c298bfe2b3b0c33c4b96ffd43a1eab6 (diff)
parent14940a067d007af445560a0a7eb414f6547a7cd4 (diff)
downloadpodman-3c9e41bb5393e0a857d8755bb50345544cc31b50.tar.gz
podman-3c9e41bb5393e0a857d8755bb50345544cc31b50.tar.bz2
podman-3c9e41bb5393e0a857d8755bb50345544cc31b50.zip
Merge pull request #12572 from rhatdan/image
Remove two GetImages functions from API
Diffstat (limited to 'pkg/api/handlers/types.go')
-rw-r--r--pkg/api/handlers/types.go40
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)