提交 931a0a55 编写于 作者: J josedonizetti 提交者: Jose Donizetti

Add hyperkit version

上级 f464fa93
......@@ -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
......
......@@ -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("", ""))
}
......@@ -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.
......
/*
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
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册