Merge pull request #34 from xing-yang/update_version
Update version in the Makefile
This commit is contained in:
5
Makefile
5
Makefile
@@ -19,18 +19,19 @@ IMAGE_NAME=csi-snapshotter
|
|||||||
IMAGE_VERSION=canary
|
IMAGE_VERSION=canary
|
||||||
IMAGE_TAG=$(REGISTRY_NAME)/$(IMAGE_NAME):$(IMAGE_VERSION)
|
IMAGE_TAG=$(REGISTRY_NAME)/$(IMAGE_NAME):$(IMAGE_VERSION)
|
||||||
|
|
||||||
|
REV=$(shell git describe --long --tags --match='v*' --dirty)
|
||||||
|
|
||||||
ifdef V
|
ifdef V
|
||||||
TESTARGS = -v -args -alsologtostderr -v 5
|
TESTARGS = -v -args -alsologtostderr -v 5
|
||||||
else
|
else
|
||||||
TESTARGS =
|
TESTARGS =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
all: csi-snapshotter
|
all: csi-snapshotter
|
||||||
|
|
||||||
csi-snapshotter:
|
csi-snapshotter:
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o ./bin/csi-snapshotter ./cmd/csi-snapshotter
|
CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-X main.version=$(REV) -extldflags "-static"' -o ./bin/csi-snapshotter ./cmd/csi-snapshotter
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm -rf bin
|
-rm -rf bin
|
||||||
|
@@ -58,12 +58,23 @@ var (
|
|||||||
resyncPeriod = flag.Duration("resync-period", 60*time.Second, "Resync interval of the controller.")
|
resyncPeriod = flag.Duration("resync-period", 60*time.Second, "Resync interval of the controller.")
|
||||||
snapshotNamePrefix = flag.String("snapshot-name-prefix", "snapshot", "Prefix to apply to the name of a created snapshot")
|
snapshotNamePrefix = flag.String("snapshot-name-prefix", "snapshot", "Prefix to apply to the name of a created snapshot")
|
||||||
snapshotNameUUIDLength = flag.Int("snapshot-name-uuid-length", -1, "Length in characters for the generated uuid of a created snapshot. Defaults behavior is to NOT truncate.")
|
snapshotNameUUIDLength = flag.Int("snapshot-name-uuid-length", -1, "Length in characters for the generated uuid of a created snapshot. Defaults behavior is to NOT truncate.")
|
||||||
|
showVersion = flag.Bool("version", false, "Show version.")
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
version = "unknown"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Set("logtostderr", "true")
|
flag.Set("logtostderr", "true")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
if *showVersion {
|
||||||
|
fmt.Println(os.Args[0], version)
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
|
glog.Infof("Version: %s", version)
|
||||||
|
|
||||||
// Create the client config. Use kubeconfig if given, otherwise assume in-cluster.
|
// Create the client config. Use kubeconfig if given, otherwise assume in-cluster.
|
||||||
config, err := buildConfig(*kubeconfig)
|
config, err := buildConfig(*kubeconfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user