diff options
-rw-r--r-- | cmd/podman/images.go | 2 | ||||
-rw-r--r-- | cmd/podman/shared/create.go | 2 | ||||
-rwxr-xr-x | contrib/cirrus/integration_test.sh | 2 | ||||
-rw-r--r-- | libpod/image/image.go | 33 | ||||
-rw-r--r-- | libpod/logs/log.go | 3 | ||||
-rw-r--r-- | libpod/runtime_pod_infra_linux.go | 2 | ||||
-rw-r--r-- | pkg/adapter/runtime_remote.go | 5 | ||||
-rw-r--r-- | pkg/rootlessport/rootlessport_linux.go | 11 |
8 files changed, 45 insertions, 15 deletions
diff --git a/cmd/podman/images.go b/cmd/podman/images.go index de61690ae..41790a5aa 100644 --- a/cmd/podman/images.go +++ b/cmd/podman/images.go @@ -155,7 +155,7 @@ func imagesCmd(c *cliconfig.ImagesValues) error { return errors.New("can not specify an image and a filter") } filters := c.Filter - if len(filters) < 1 { + if len(filters) < 1 && len(image) > 0 { filters = append(filters, fmt.Sprintf("reference=%s", image)) } diff --git a/cmd/podman/shared/create.go b/cmd/podman/shared/create.go index 11b2bd027..8968f10e8 100644 --- a/cmd/podman/shared/create.go +++ b/cmd/podman/shared/create.go @@ -101,7 +101,7 @@ func CreateContainer(ctx context.Context, c *GenericCLIResults, runtime *libpod. if err != nil { return nil, nil, err } - imageData, err = newImage.Inspect(ctx) + imageData, err = newImage.InspectNoSize(ctx) if err != nil { return nil, nil, err } diff --git a/contrib/cirrus/integration_test.sh b/contrib/cirrus/integration_test.sh index 20e067c93..6341bcb4a 100755 --- a/contrib/cirrus/integration_test.sh +++ b/contrib/cirrus/integration_test.sh @@ -45,7 +45,7 @@ case "$SPECIALMODE" in bindings) make make install PREFIX=/usr ETCDIR=/etc - cd pkg/bindings/test && ginkgo -r + cd pkg/bindings/test && ginkgo -trace -noColor -debug -r ;; none) make diff --git a/libpod/image/image.go b/libpod/image/image.go index 43fd52a1a..5f914ed79 100644 --- a/libpod/image/image.go +++ b/libpod/image/image.go @@ -916,12 +916,7 @@ func (i *Image) imageInspectInfo(ctx context.Context) (*types.ImageInspectInfo, return i.inspectInfo, nil } -// Inspect returns an image's inspect data -func (i *Image) Inspect(ctx context.Context) (*inspect.ImageData, error) { - span, _ := opentracing.StartSpanFromContext(ctx, "imageInspect") - span.SetTag("type", "image") - defer span.Finish() - +func (i *Image) inspect(ctx context.Context, calculateSize bool) (*inspect.ImageData, error) { ociv1Img, err := i.ociv1Image(ctx) if err != nil { ociv1Img = &ociv1.Image{} @@ -936,8 +931,10 @@ func (i *Image) Inspect(ctx context.Context) (*inspect.ImageData, error) { } size := int64(-1) - if usize, err := i.Size(ctx); err == nil { - size = int64(*usize) + if calculateSize { + if usize, err := i.Size(ctx); err == nil { + size = int64(*usize) + } } repoTags, err := i.RepoTags() @@ -1002,6 +999,26 @@ func (i *Image) Inspect(ctx context.Context) (*inspect.ImageData, error) { return data, nil } +// Inspect returns an image's inspect data +func (i *Image) Inspect(ctx context.Context) (*inspect.ImageData, error) { + span, _ := opentracing.StartSpanFromContext(ctx, "imageInspect") + + span.SetTag("type", "image") + defer span.Finish() + + return i.inspect(ctx, true) +} + +// InspectNoSize returns an image's inspect data without calculating the size for the image +func (i *Image) InspectNoSize(ctx context.Context) (*inspect.ImageData, error) { + span, _ := opentracing.StartSpanFromContext(ctx, "imageInspectNoSize") + + span.SetTag("type", "image") + defer span.Finish() + + return i.inspect(ctx, false) +} + // Import imports and image into the store and returns an image func (ir *Runtime) Import(ctx context.Context, path, reference string, writer io.Writer, signingOptions SigningOptions, imageConfig ociv1.Image) (*Image, error) { src, err := tarball.Transport.ParseReference(path) diff --git a/libpod/logs/log.go b/libpod/logs/log.go index 200ef3e99..6ad2a305f 100644 --- a/libpod/logs/log.go +++ b/libpod/logs/log.go @@ -167,8 +167,7 @@ func (l *LogLine) String(options *LogOptions) string { var out string if options.Multi { if options.UseName { - cname := l.CName - out = fmt.Sprintf("%s ", cname) + out = l.CName + " " } else { cid := l.CID if len(cid) > 12 { diff --git a/libpod/runtime_pod_infra_linux.go b/libpod/runtime_pod_infra_linux.go index 27735a9b2..279cafa39 100644 --- a/libpod/runtime_pod_infra_linux.go +++ b/libpod/runtime_pod_infra_linux.go @@ -147,7 +147,7 @@ func (r *Runtime) createInfraContainer(ctx context.Context, p *Pod) (*Container, return nil, err } - data, err := newImage.Inspect(ctx) + data, err := newImage.InspectNoSize(ctx) if err != nil { return nil, err } diff --git a/pkg/adapter/runtime_remote.go b/pkg/adapter/runtime_remote.go index 220d4cf75..d87de481c 100644 --- a/pkg/adapter/runtime_remote.go +++ b/pkg/adapter/runtime_remote.go @@ -201,8 +201,11 @@ func (r *LocalRuntime) GetRWImages() ([]*ContainerImage, error) { } func (r *LocalRuntime) GetFilteredImages(filters []string, rwOnly bool) ([]*ContainerImage, error) { + if len(filters) > 0 { + return nil, errors.Wrap(define.ErrNotImplemented, "filtering images is not supported on the remote client") + } var newImages []*ContainerImage - images, err := iopodman.ListImagesWithFilters().Call(r.Conn, filters) + images, err := iopodman.ListImages().Call(r.Conn) if err != nil { return nil, err } diff --git a/pkg/rootlessport/rootlessport_linux.go b/pkg/rootlessport/rootlessport_linux.go index 2b51f4e09..febfc2268 100644 --- a/pkg/rootlessport/rootlessport_linux.go +++ b/pkg/rootlessport/rootlessport_linux.go @@ -160,6 +160,13 @@ func parent() error { return err } + childErrCh := make(chan error) + go func() { + err := cmd.Wait() + childErrCh <- err + close(childErrCh) + }() + defer func() { if err := syscall.Kill(cmd.Process.Pid, syscall.SIGTERM); err != nil { logrus.WithError(err).Warn("kill child process") @@ -174,6 +181,10 @@ outer: case <-initComplete: logrus.Infof("initComplete is closed; parent and child established the communication channel") break outer + case err := <-childErrCh: + if err != nil { + return err + } case err := <-errCh: if err != nil { return err |