Impement bulk polling of volumes

This implements Bulk volume polling using ideas presented by
justin in https://github.com/kubernetes/kubernetes/pull/39564

But it changes the implementation to use an interface
and doesn't affect other implementations.
This commit is contained in:
Hemant Kumar
2017-02-12 23:40:30 -05:00
parent cdf0cae9e4
commit 786da1de12
38 changed files with 457 additions and 63 deletions

View File

@@ -187,6 +187,14 @@ type Attacher interface {
MountDevice(spec *Spec, devicePath string, deviceMountPath string) error
}
type BulkVolumeVerifier interface {
// BulkVerifyVolumes checks whether the list of volumes still attached to the
// the clusters in the node. It returns a map which maps from the volume spec to the checking result.
// If an error occurs during check - error should be returned and volume on nodes
// should be assumed as still attached.
BulkVerifyVolumes(volumesByNode map[types.NodeName][]*Spec) (map[types.NodeName]map[*Spec]bool, error)
}
// Detacher can detach a volume from a node.
type Detacher interface {
// Detach the given device from the node with the given Name.