StorageOS support for containerized kubelet and mount options

This change queries the StorageOS API to retrieve the volume
device dir when a volume is attached, rather than relying on
the default /var/lib/storageos/volumes directory.  This allows
all or some nodes to have kubelet running in a container with
the StorageOS volume path mounted in, which is required for
Azure ACS support.

Volume mount options are also supported.
This commit is contained in:
Simon Croome
2018-02-06 13:28:36 +00:00
parent 8d0ba4a978
commit 1a91403e43
4 changed files with 54 additions and 10 deletions

View File

@@ -108,6 +108,9 @@ func (f fakeAPI) VolumeUnmount(opts storageostypes.VolumeUnmountOptions) error {
func (f fakeAPI) VolumeDelete(opts storageostypes.DeleteOptions) error {
return nil
}
func (f fakeAPI) Controller(ref string) (*storageostypes.Controller, error) {
return &storageostypes.Controller{}, nil
}
func TestCreateVolume(t *testing.T) {
@@ -224,7 +227,7 @@ func TestAttachVolume(t *testing.T) {
mounter: &mount.FakeMounter{},
plugin: plug.(*storageosPlugin),
},
devicePath: tmpDir,
deviceDir: tmpDir,
}
if err != nil {
t.Errorf("Failed to make a new Mounter: %v", err)