From 046178e55f72ed9db7cf5898d3be91b0112ab94f Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Tue, 27 Aug 2019 15:25:54 -0400 Subject: Add function for looking up volumes by partial name This isn't included in Docker, but seems handy enough. Use the new API for 'volume rm' and 'volume inspect'. Fixes #3891 Signed-off-by: Matthew Heon --- pkg/adapter/runtime_remote.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'pkg/adapter/runtime_remote.go') diff --git a/pkg/adapter/runtime_remote.go b/pkg/adapter/runtime_remote.go index 718a6d542..f079b914a 100644 --- a/pkg/adapter/runtime_remote.go +++ b/pkg/adapter/runtime_remote.go @@ -622,13 +622,18 @@ func (r *LocalRuntime) CreateVolume(ctx context.Context, c *cliconfig.VolumeCrea } // RemoveVolumes removes volumes over a varlink connection for the remote client -func (r *LocalRuntime) RemoveVolumes(ctx context.Context, c *cliconfig.VolumeRmValues) ([]string, error) { +func (r *LocalRuntime) RemoveVolumes(ctx context.Context, c *cliconfig.VolumeRmValues) ([]string, map[string]error, error) { rmOpts := iopodman.VolumeRemoveOpts{ All: c.All, Force: c.Force, Volumes: c.InputArgs, } - return iopodman.VolumeRemove().Call(r.Conn, rmOpts) + success, failures, err := iopodman.VolumeRemove().Call(r.Conn, rmOpts) + stringsToErrors := make(map[string]error) + for k, v := range failures { + stringsToErrors[k] = errors.New(v) + } + return success, stringsToErrors, err } func (r *LocalRuntime) Push(ctx context.Context, srcName, destination, manifestMIMEType, authfile, digestfile, signaturePolicyPath string, writer io.Writer, forceCompress bool, signingOptions image.SigningOptions, dockerRegistryOptions *image.DockerRegistryOptions, additionalDockerArchiveTags []reference.NamedTagged) error { -- cgit v1.2.3-54-g00ecf