File tree 3 files changed +6
-2
lines changed
3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 9
9
"github.com/rancher/k3s/pkg/cli/cmds"
10
10
"github.com/rancher/norman/pkg/resolvehome"
11
11
"github.com/rancher/norman/signal"
12
+ "github.com/sirupsen/logrus"
12
13
"github.com/urfave/cli"
13
14
)
14
15
@@ -25,6 +26,8 @@ func Run(ctx *cli.Context) error {
25
26
return fmt .Errorf ("--server is required" )
26
27
}
27
28
29
+ logrus .Infof ("Starting k3s agent %s" , ctx .App .Version )
30
+
28
31
dataDir , err := resolvehome .Resolve (cmds .AgentConfig .DataDir )
29
32
if err != nil {
30
33
return err
@@ -35,5 +38,6 @@ func Run(ctx *cli.Context) error {
35
38
cfg .DataDir = dataDir
36
39
37
40
contextCtx := signal .SigTermCancelContext (context .Background ())
41
+
38
42
return agent .Run (contextCtx , cfg )
39
43
}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ func NewApp() *cli.App {
16
16
app := cli .NewApp ()
17
17
app .Name = appName
18
18
app .Usage = "Kubernetes, but small and simple"
19
- app .Version = version .Version
19
+ app .Version = fmt . Sprintf ( "%s (%s)" , version .Version , version . GitCommit )
20
20
cli .VersionPrinter = func (c * cli.Context ) {
21
21
fmt .Printf ("%s version %s\n " , app .Name , app .Version )
22
22
}
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ source $(dirname $0)/version.sh
5
5
6
6
cd $( dirname $0 ) /..
7
7
8
- LDFLAGS=" -X github.com/rancher/k3s/version.Version=$VERSION -w -s"
8
+ LDFLAGS=" -X github.com/rancher/k3s/pkg/ version.Version=$VERSION -X github.com/rancher/k3s/pkg/version.GitCommit= ${COMMIT : 0 : 8} -w -s"
9
9
STATIC=" -extldflags '-static'"
10
10
STATIC_SQLITE=" -extldflags '-static -lm -ldl -lz -lpthread'"
11
11
TAGS=" ctrd apparmor seccomp no_btrfs netgo osusergo"
You can’t perform that action at this time.
0 commit comments