mirror of
https://github.com/containers/podman.git
synced 2025-05-21 00:56:36 +08:00
v2 system subcommand
add system df, info, load, renumber, and migrate Refactor for specialized libpod engines add the ability to prune images, volumes, containers, and pods Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
@ -3,6 +3,7 @@ package libpod
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/containers/libpod/libpod/define"
|
||||
"github.com/containers/libpod/libpod/lock"
|
||||
)
|
||||
|
||||
@ -133,3 +134,15 @@ func (v *Volume) Config() (*VolumeConfig, error) {
|
||||
err := JSONDeepCopy(v.config, &config)
|
||||
return &config, err
|
||||
}
|
||||
|
||||
// VolumeInUse goes through the container dependencies of a volume
|
||||
// and checks if the volume is being used by any container.
|
||||
func (v *Volume) VolumesInUse() ([]string, error) {
|
||||
v.lock.Lock()
|
||||
defer v.lock.Unlock()
|
||||
|
||||
if !v.valid {
|
||||
return nil, define.ErrVolumeRemoved
|
||||
}
|
||||
return v.runtime.state.VolumeInUse(v)
|
||||
}
|
||||
|
Reference in New Issue
Block a user