From 2c00fd686c4ba40035219f26af288a00a9ed6659 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Fri, 1 Mar 2019 20:43:42 +0100 Subject: [PATCH] hostpath: embed version number The version number passed by the common release tools goes into main.version. It has to be passed to the hostpath plugin implementation. This broke after v1.0 when introducing the common build rules, i.e. no releases were affected. --- cmd/hostpathplugin/main.go | 2 +- pkg/hostpath/hostpath.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) 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)