ScaleIO: Use VolumeHost.GetExec() to execute utilities
This prepares volume plugins to run things in containers instead of running them on the host. As consequence, a mount.Exec interface needs to be passed from VolumeHost down to SioClient.
This commit is contained in:
@@ -20,6 +20,8 @@ import (
|
||||
"errors"
|
||||
"strconv"
|
||||
|
||||
"k8s.io/kubernetes/pkg/util/mount"
|
||||
|
||||
"github.com/golang/glog"
|
||||
|
||||
siotypes "github.com/codedellemc/goscaleio/types/v1"
|
||||
@@ -36,9 +38,10 @@ type storageInterface interface {
|
||||
type sioMgr struct {
|
||||
client sioInterface
|
||||
configData map[string]string
|
||||
exec mount.Exec
|
||||
}
|
||||
|
||||
func newSioMgr(configs map[string]string) (*sioMgr, error) {
|
||||
func newSioMgr(configs map[string]string, exec mount.Exec) (*sioMgr, error) {
|
||||
if configs == nil {
|
||||
return nil, errors.New("missing configuration data")
|
||||
}
|
||||
@@ -47,7 +50,7 @@ func newSioMgr(configs map[string]string) (*sioMgr, error) {
|
||||
configs[confKey.sdcRootPath] = defaultString(configs[confKey.sdcRootPath], sdcRootPath)
|
||||
configs[confKey.storageMode] = defaultString(configs[confKey.storageMode], "ThinProvisioned")
|
||||
|
||||
mgr := &sioMgr{configData: configs}
|
||||
mgr := &sioMgr{configData: configs, exec: exec}
|
||||
return mgr, nil
|
||||
}
|
||||
|
||||
@@ -67,7 +70,7 @@ func (m *sioMgr) getClient() (sioInterface, error) {
|
||||
certsEnabled := b
|
||||
|
||||
glog.V(4).Info(log("creating new client for gateway %s", gateway))
|
||||
client, err := newSioClient(gateway, username, password, certsEnabled)
|
||||
client, err := newSioClient(gateway, username, password, certsEnabled, m.exec)
|
||||
if err != nil {
|
||||
glog.Error(log("failed to create scaleio client: %v", err))
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user