Skip to content

Commit

Permalink
hostpath: embed version number
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pohly committed Mar 6, 2019
1 parent 840f6ca commit 2c00fd6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/hostpathplugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion pkg/hostpath/hostpath.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand All @@ -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)
Expand Down

0 comments on commit 2c00fd6

Please sign in to comment.