Attach detach controller business logic added

Split controller cache into actual and desired state of world.
Controller will only operate on volumes scheduled to nodes that
have the "volumes.kubernetes.io/controller-managed-attach" annotation.
This commit is contained in:
saadali
2016-04-29 23:36:27 -07:00
parent 4215fe57a5
commit 92500a20d7
26 changed files with 3905 additions and 1074 deletions

View File

@@ -133,6 +133,18 @@ type AttachableVolumePlugin interface {
VolumePlugin
NewAttacher() (Attacher, error)
NewDetacher() (Detacher, error)
// GetUniqueVolumeName returns a unique name representing the volume
// defined in spec. e.g. pluginname-deviceName-readwrite
// This helps ensures that the same operation (attach/detach) is never
// started on the same volume.
// If the plugin does not support the given spec, this returns an error.
GetUniqueVolumeName(spec *Spec) (string, error)
// GetDeviceName returns the name or ID of the device referenced in the
// specified volume spec. This is passed by callers to the Deatch method.
// If the plugin does not support the given spec, this returns an error.
GetDeviceName(spec *Spec) (string, error)
}
// VolumeHost is an interface that plugins can use to access the kubelet.