Add support for flex volume. Flex volume adds support for thirdparty(vendor)

volumes and custom mounts.
This commit is contained in:
Chakravarthy Nelluri
2015-09-30 11:31:53 -07:00
parent 56f72aeb45
commit fa76de79e5
47 changed files with 40874 additions and 37685 deletions

View File

@@ -59,7 +59,7 @@ type VolumePlugin interface {
// Init initializes the plugin. This will be called exactly once
// before any New* calls are made - implementations of plugins may
// depend on this.
Init(host VolumeHost)
Init(host VolumeHost) error
// Name returns the plugin's name. Plugins should use namespaced names
// such as "example.com/volume". The "kubernetes.io" namespace is
@@ -263,7 +263,12 @@ func (pm *VolumePluginMgr) InitPlugins(plugins []VolumePlugin, host VolumeHost)
allErrs = append(allErrs, fmt.Errorf("volume plugin %q was registered more than once", name))
continue
}
plugin.Init(host)
err := plugin.Init(host)
if err != nil {
glog.Errorf("Failed to load volume plugin %s, error: %s", plugin, err.Error())
allErrs = append(allErrs, err)
continue
}
pm.plugins[name] = plugin
glog.V(1).Infof("Loaded volume plugin %q", name)
}