diff --git a/cmd/hostpathplugin/main.go b/cmd/hostpathplugin/main.go index 48f5feb78..601d5a92c 100644 --- a/cmd/hostpathplugin/main.go +++ b/cmd/hostpathplugin/main.go @@ -52,7 +52,7 @@ func main() { } func handle() { - driver, err := hostpath.NewHostPathDriver(*driverName, *nodeID, *endpoint) + driver, err := hostpath.NewHostPathDriver(*driverName, *nodeID, *endpoint, version) if err != nil { fmt.Printf("Failed to initialize driver: %s", err.Error()) os.Exit(1) diff --git a/pkg/hostpath/hostpath.go b/pkg/hostpath/hostpath.go index 4d7d9538b..242660f3e 100644 --- a/pkg/hostpath/hostpath.go +++ b/pkg/hostpath/hostpath.go @@ -74,7 +74,7 @@ func init() { hostPathVolumeSnapshots = map[string]hostPathSnapshot{} } -func NewHostPathDriver(driverName, nodeID, endpoint string) (*hostPath, error) { +func NewHostPathDriver(driverName, nodeID, endpoint, version string) (*hostPath, error) { if driverName == "" { return nil, fmt.Errorf("No driver name provided") } @@ -86,6 +86,9 @@ func NewHostPathDriver(driverName, nodeID, endpoint string) (*hostPath, error) { if endpoint == "" { return nil, fmt.Errorf("No driver endpoint provided") } + if version != "" { + vendorVersion = version + } glog.Infof("Driver: %v ", driverName) glog.Infof("Version: %s", vendorVersion)