summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/images.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2021-10-08 14:45:19 +0200
committerValentin Rothberg <rothberg@redhat.com>2021-10-08 14:47:33 +0200
commitfad14dafe186bb6cebfd7987db9cd15aa2a23585 (patch)
tree7768329980fa37ef64dee59fdbadfe900ddee916 /pkg/domain/infra/abi/images.go
parent14c0fcc6b7b3e8c1f28efea329ab9a6bf0d99b70 (diff)
downloadpodman-fad14dafe186bb6cebfd7987db9cd15aa2a23585.tar.gz
podman-fad14dafe186bb6cebfd7987db9cd15aa2a23585.tar.bz2
podman-fad14dafe186bb6cebfd7987db9cd15aa2a23585.zip
faster image inspection
Vendor the latest HEAD in c/common to pull in changes for a faster inspection of images. Previously, only the size computation was optional, now the one for the parent image is as well. In many cases, the parent image is not needed but it takes around 10ms on my local machine. With this change, we cut off 10ms from many code paths, most importantly, container creation. [NO NEW TESTS NEEDED] Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/domain/infra/abi/images.go')
-rw-r--r--pkg/domain/infra/abi/images.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go
index c06059205..8a0b87cab 100644
--- a/pkg/domain/infra/abi/images.go
+++ b/pkg/domain/infra/abi/images.go
@@ -252,6 +252,8 @@ func (ir *ImageEngine) Pull(ctx context.Context, rawImage string, options entiti
func (ir *ImageEngine) Inspect(ctx context.Context, namesOrIDs []string, opts entities.InspectOptions) ([]*entities.ImageInspectReport, []error, error) {
reports := []*entities.ImageInspectReport{}
errs := []error{}
+
+ inspectOptions := &libimage.InspectOptions{WithParent: true, WithSize: true}
for _, i := range namesOrIDs {
img, _, err := ir.Libpod.LibimageRuntime().LookupImage(i, nil)
if err != nil {
@@ -259,7 +261,7 @@ func (ir *ImageEngine) Inspect(ctx context.Context, namesOrIDs []string, opts en
errs = append(errs, err)
continue
}
- result, err := img.Inspect(ctx, true)
+ result, err := img.Inspect(ctx, inspectOptions)
if err != nil {
// This is more likely to be fatal.
return nil, nil, err