File tree 3 files changed +36
-1
lines changed
3 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -367,7 +367,7 @@ release-minikube: out/minikube checksum
367
367
out/docker-machine-driver-kvm2 :
368
368
go build \
369
369
-installsuffix " static" \
370
- -ldflags " -X k8s.io/minikube/pkg/drivers/kvm/version.VERSION =$( VERSION) " \
370
+ -ldflags " -X k8s.io/minikube/pkg/drivers/kvm.version =$( VERSION) " \
371
371
-tags libvirt.1.3.1 \
372
372
-o $(BUILD_DIR ) /docker-machine-driver-kvm2 \
373
373
k8s.io/minikube/cmd/drivers/kvm
Original file line number Diff line number Diff line change @@ -19,10 +19,18 @@ limitations under the License.
19
19
package main
20
20
21
21
import (
22
+ "fmt"
23
+ "os"
24
+
22
25
"github.com/docker/machine/libmachine/drivers/plugin"
23
26
"k8s.io/minikube/pkg/drivers/kvm"
24
27
)
25
28
26
29
func main () {
30
+ if len (os .Args ) > 1 && os .Args [1 ] == "--version" {
31
+ fmt .Println (kvm .GetVersion ())
32
+ return
33
+ }
34
+
27
35
plugin .RegisterDriver (kvm .NewDriver ("" , "" ))
28
36
}
Original file line number Diff line number Diff line change
1
+ /*
2
+ Copyright 2016 The Kubernetes Authors All rights reserved.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */
16
+
17
+ package kvm
18
+
19
+ // The current version of the docker-machine-driver-kvm2
20
+
21
+ // version is a private field and should be set when compiling with --ldflags="-X k8s.io/minikube/pkg/drivers/kvm.version=vX.Y.Z"
22
+ var version = "v0.0.0-unset"
23
+
24
+ // GetVersion returns the current docker-machine-driver-kvm2 version
25
+ func GetVersion () string {
26
+ return version
27
+ }
You can’t perform that action at this time.
0 commit comments