Add Size and RefCount fields to types.Volume
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
parent
148aef9199
commit
c6db1e9c1b
|
@ -438,6 +438,8 @@ type Volume struct {
|
||||||
Status map[string]interface{} `json:",omitempty"` // Status provides low-level status information about the volume
|
Status map[string]interface{} `json:",omitempty"` // Status provides low-level status information about the volume
|
||||||
Labels map[string]string // Labels is metadata specific to the volume
|
Labels map[string]string // Labels is metadata specific to the volume
|
||||||
Scope string // Scope describes the level at which the volume exists (e.g. `global` for cluster-wide or `local` for machine level)
|
Scope string // Scope describes the level at which the volume exists (e.g. `global` for cluster-wide or `local` for machine level)
|
||||||
|
Size int64 // Size holds how much disk space is used by the (local driver only). Sets to -1 if not provided.
|
||||||
|
RefCount int // RefCount holds the number of containers having this volume attached to them. Sets to -1 if not provided.
|
||||||
}
|
}
|
||||||
|
|
||||||
// VolumesListResponse contains the response for the remote API:
|
// VolumesListResponse contains the response for the remote API:
|
||||||
|
|
|
@ -27,8 +27,10 @@ type mounts []container.Mount
|
||||||
// volumeToAPIType converts a volume.Volume to the type used by the remote API
|
// volumeToAPIType converts a volume.Volume to the type used by the remote API
|
||||||
func volumeToAPIType(v volume.Volume) *types.Volume {
|
func volumeToAPIType(v volume.Volume) *types.Volume {
|
||||||
tv := &types.Volume{
|
tv := &types.Volume{
|
||||||
Name: v.Name(),
|
Name: v.Name(),
|
||||||
Driver: v.DriverName(),
|
Driver: v.DriverName(),
|
||||||
|
Size: -1,
|
||||||
|
RefCount: -1,
|
||||||
}
|
}
|
||||||
if v, ok := v.(volume.LabeledVolume); ok {
|
if v, ok := v.(volume.LabeledVolume); ok {
|
||||||
tv.Labels = v.Labels()
|
tv.Labels = v.Labels()
|
||||||
|
|
Loading…
Reference in New Issue