diff --git a/Makefile b/Makefile index ccc6d1eb876ffbf0d1a46057b9072df5ac512723..1aed913f8699730d067a7f57e0a96b38150cb0c9 100755 --- a/Makefile +++ b/Makefile @@ -329,7 +329,9 @@ out/docker-machine-driver-hyperkit: ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y) $(call DOCKER,$(HYPERKIT_BUILD_IMAGE),CC=o64-clang CXX=o64-clang++ /usr/bin/make $@) else - GOOS=darwin CGO_ENABLED=1 go build -o $(BUILD_DIR)/docker-machine-driver-hyperkit k8s.io/minikube/cmd/drivers/hyperkit + GOOS=darwin CGO_ENABLED=1 go build \ + -ldflags "-X k8s.io/minikube/pkg/drivers/hyperkit.version=$(VERSION)" \ + -o $(BUILD_DIR)/docker-machine-driver-hyperkit k8s.io/minikube/cmd/drivers/hyperkit endif .PHONY: install-hyperkit-driver diff --git a/cmd/drivers/hyperkit/main.go b/cmd/drivers/hyperkit/main.go index 5089b6e9ec287a9236ec72f2ae3912205bdbc58d..c5b35ed6f8eea24883dcca296bca57e0bab9e43f 100644 --- a/cmd/drivers/hyperkit/main.go +++ b/cmd/drivers/hyperkit/main.go @@ -19,10 +19,18 @@ limitations under the License. package main import ( + "fmt" + "os" + "github.com/docker/machine/libmachine/drivers/plugin" "k8s.io/minikube/pkg/drivers/hyperkit" ) func main() { + if len(os.Args) > 1 && os.Args[1] == "--version" { + fmt.Println(hyperkit.GetVersion()) + return + } + plugin.RegisterDriver(hyperkit.NewDriver("", "")) } diff --git a/docs/drivers.md b/docs/drivers.md index 9c2b3fccb7cf941e941cf8b210eb08c3f50bb2ac..e3b3c00836dd193ea3cfc092f62df893505967f5 100644 --- a/docs/drivers.md +++ b/docs/drivers.md @@ -133,6 +133,14 @@ or, to use hyperkit as a default driver for minikube: minikube config set vm-driver hyperkit ``` +### Troubleshoot + +Make sure you are running the lastest version of your driver. + +```shell +docker-machine-driver-hyperkit --version +``` + ## HyperV driver Hyper-v users may need to create a new external network switch as described [here](https://docs.docker.com/machine/drivers/hyper-v/). This step may prevent a problem in which `minikube start` hangs indefinitely, unable to ssh into the minikube virtual machine. In this add, add the `--hyperv-virtual-switch=switch-name` argument to the `minikube start` command. diff --git a/pkg/drivers/hyperkit/version.go b/pkg/drivers/hyperkit/version.go new file mode 100644 index 0000000000000000000000000000000000000000..d72959a8a510dbe0876ee6dbcee6c2bac38d8444 --- /dev/null +++ b/pkg/drivers/hyperkit/version.go @@ -0,0 +1,27 @@ +/* +Copyright 2016 The Kubernetes Authors All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package hyperkit + +// The current version of the docker-machine-driver-hyperkit + +// version is a private field and should be set when compiling with --ldflags="-X k8s.io/minikube/pkg/drivers/hyperkit.version=vX.Y.Z" +var version = "v0.0.0-unset" + +// GetVersion returns the current docker-machine-driver-hyperkit version +func GetVersion() string { + return version +}