diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2022-02-14 15:43:52 -0500 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2022-02-23 14:27:52 -0500 |
commit | ee7cf3cc2c212ff7a24bda49f95d494d99eb3cd7 (patch) | |
tree | ccb774cc6973832cc9d053eb46ac3624e4a0639a /libpod/container_inspect.go | |
parent | eb9fe52a555361f49f7b015163ecfcd91f1d6091 (diff) | |
download | podman-ee7cf3cc2c212ff7a24bda49f95d494d99eb3cd7.tar.gz podman-ee7cf3cc2c212ff7a24bda49f95d494d99eb3cd7.tar.bz2 podman-ee7cf3cc2c212ff7a24bda49f95d494d99eb3cd7.zip |
Don't log errors on removing volumes inuse, if container --volumes-from
When removing a container created with a --volumes-from a container
created with a built in volume, we complain if the original container
still exists. Since this is an expected state, we should not complain
about it.
Fixes: https://github.com/containers/podman/issues/12808
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'libpod/container_inspect.go')
-rw-r--r-- | libpod/container_inspect.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libpod/container_inspect.go b/libpod/container_inspect.go index 1344fc659..0bbfe3b70 100644 --- a/libpod/container_inspect.go +++ b/libpod/container_inspect.go @@ -51,6 +51,17 @@ func (c *Container) Inspect(size bool) (*define.InspectContainerData, error) { return c.inspectLocked(size) } +func (c *Container) volumesFrom() ([]string, error) { + ctrSpec, err := c.specFromState() + if err != nil { + return nil, err + } + if ctrs, ok := ctrSpec.Annotations[define.InspectAnnotationVolumesFrom]; ok { + return strings.Split(ctrs, ","), nil + } + return nil, nil +} + func (c *Container) getContainerInspectData(size bool, driverData *define.DriverData) (*define.InspectContainerData, error) { config := c.config runtimeInfo := c.state |