mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
chore(volumes): add client methods for volume management, e2e test
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/docker/docker/api/types/mount"
|
||||
"github.com/docker/docker/api/types/volume"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -43,6 +44,8 @@ type BindOptions struct {
|
||||
// VolumeOptions represents options for a managed volume.
|
||||
type VolumeOptions struct {
|
||||
// Driver specifies the volume driver and its options for volume creation.
|
||||
// TODO: It seems we don't really need Driver and Labels if we only support externally managed volumes.
|
||||
// However we may need them in the future if we add support for isolated container-scoped volumes.
|
||||
Driver *mount.Driver `json:",omitempty"`
|
||||
// Labels are key-value metadata to apply to the volume if creating a new volume.
|
||||
Labels map[string]string `json:",omitempty"`
|
||||
@@ -182,3 +185,13 @@ func sortVolumeMounts(mounts []VolumeMount) {
|
||||
return false
|
||||
})
|
||||
}
|
||||
|
||||
// MachineVolume represents a volume on a specific machine.
|
||||
type MachineVolume struct {
|
||||
// MachineID is the ID of the machine where the volume exists.
|
||||
MachineID string
|
||||
// MachineName is the name of the machine where the volume exists.
|
||||
MachineName string
|
||||
// Volume is the Docker volume model.
|
||||
Volume volume.Volume
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user