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:
baude
2020-05-01 12:57:41 -05:00
parent 4a1331d0af
commit 25312bb5b4
19 changed files with 817 additions and 26 deletions

View File

@ -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)
}