Skip to content

Commit

Permalink
Merge pull request #24 from pohly/version-output
Browse files Browse the repository at this point in the history
embed version number
  • Loading branch information
k8s-ci-robot authored Mar 26, 2019
2 parents 24a7913 + 2c00fd6 commit 4c94fae
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 4c94fae

Please sign in to comment.