File tree Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -2,14 +2,13 @@ GO_SRCS := $(shell find . -type f -name '*.go' -a ! \( -name 'zz_generated*' -o
22GO_TESTS := $(shell find . -type f -name '* _test.go')
33TAG_NAME = $(shell git describe --tags --abbrev=0 --exact-match 2>/dev/null)
44GIT_COMMIT = $(shell git rev-parse --short=7 HEAD)
5- K0SCTL_VERSION = $(or ${TAG_NAME},dev)
65ifdef TAG_NAME
76 ENVIRONMENT = production
87endif
98ENVIRONMENT ?= development
109PREFIX = /usr/local
1110
12- LD_FLAGS = -s -w -X github.com/k0sproject/k0sctl/version.Environment=$(ENVIRONMENT ) -X github.com/k0sproject/k0sctl/version.GitCommit =$(GIT_COMMIT ) -X github.com/k0sproject/k0sctl/version .Version=$(K0SCTL_VERSION )
11+ LD_FLAGS = -s -w -X github.com/k0sproject/k0sctl/version.Environment=$(ENVIRONMENT ) -X github.com/carlmjohnson/versioninfo.Revision =$(GIT_COMMIT ) -X github.com/carlmjohnson/versioninfo .Version=$(TAG_NAME )
1312BUILD_FLAGS = -trimpath -a -tags "netgo,osusergo,static_build" -installsuffix netgo -ldflags "$(LD_FLAGS ) -extldflags '-static'"
1413
1514k0sctl : $(GO_SRCS )
@@ -81,4 +80,4 @@ test: $(GO_SRCS) $(GO_TESTS)
8180.PHONY : install
8281install : k0sctl
8382 install -d $(DESTDIR )$(PREFIX ) /bin/
84- install -m 755 k0sctl $(DESTDIR )$(PREFIX ) /bin/
83+ install -m 755 k0sctl $(DESTDIR )$(PREFIX ) /bin/
Original file line number Diff line number Diff line change @@ -100,3 +100,5 @@ require (
100100 sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
101101 sigs.k8s.io/yaml v1.3.0 // indirect
102102)
103+
104+ replace github.com/carlmjohnson/versioninfo => github.com/kke/versioninfo v0.0.0-20230802075057-8c93d82afe5b
Original file line number Diff line number Diff line change @@ -28,8 +28,6 @@ github.com/bmatcuk/doublestar/v4 v4.6.0 h1:HTuxyug8GyFbRkrffIpzNCSK4luc0TY3wzXvz
2828github.com/bmatcuk/doublestar/v4 v4.6.0 /go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc =
2929github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY =
3030github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 /go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4 =
31- github.com/carlmjohnson/versioninfo v0.22.4 h1:AucUHDSKmk6j7Yx3dECGUxaowGHOAN0Zx5/EBtsXn4Y =
32- github.com/carlmjohnson/versioninfo v0.22.4 /go.mod h1:QT9mph3wcVfISUKd0i9sZfVrPviHuSF+cUtLjm2WSf8 =
3331github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w =
3432github.com/cpuguy83/go-md2man/v2 v2.0.2 /go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o =
3533github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI =
@@ -126,6 +124,8 @@ github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4
126124github.com/kevinburke/ssh_config v1.2.0 /go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM =
127125github.com/kisielk/errcheck v1.5.0 /go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8 =
128126github.com/kisielk/gotool v1.0.0 /go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck =
127+ github.com/kke/versioninfo v0.0.0-20230802075057-8c93d82afe5b h1:4/phMKkkDufarRagZpMTL1EHU6Oj/Vr9izfuo9zsNKc =
128+ github.com/kke/versioninfo v0.0.0-20230802075057-8c93d82afe5b /go.mod h1:QT9mph3wcVfISUKd0i9sZfVrPviHuSF+cUtLjm2WSf8 =
129129github.com/kr/pretty v0.1.0 /go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo =
130130github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0 =
131131github.com/kr/pty v1.1.1 /go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ =
Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ import (
88 "github.com/k0sproject/k0sctl/analytics"
99 "github.com/k0sproject/k0sctl/cmd"
1010 log "github.com/sirupsen/logrus"
11+
12+ // blank import to make sure versioninfo is included in the binary
13+ _ "github.com/carlmjohnson/versioninfo"
14+ // blank import to make sure versioninfo is included in the binary
15+ _ "github.com/k0sproject/k0sctl/version"
1116)
1217
1318func handlepanic () {
You can’t perform that action at this time.
0 commit comments