File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 "github.com/rancher/k3s/pkg/cli/cmds"
1010 "github.com/rancher/norman/pkg/resolvehome"
1111 "github.com/rancher/norman/signal"
12+ "github.com/sirupsen/logrus"
1213 "github.com/urfave/cli"
1314)
1415
@@ -25,6 +26,8 @@ func Run(ctx *cli.Context) error {
2526 return fmt .Errorf ("--server is required" )
2627 }
2728
29+ logrus .Infof ("Starting k3s agent %s" , ctx .App .Version )
30+
2831 dataDir , err := resolvehome .Resolve (cmds .AgentConfig .DataDir )
2932 if err != nil {
3033 return err
@@ -35,5 +38,6 @@ func Run(ctx *cli.Context) error {
3538 cfg .DataDir = dataDir
3639
3740 contextCtx := signal .SigTermCancelContext (context .Background ())
41+
3842 return agent .Run (contextCtx , cfg )
3943}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ func NewApp() *cli.App {
1616 app := cli .NewApp ()
1717 app .Name = appName
1818 app .Usage = "Kubernetes, but small and simple"
19- app .Version = version .Version
19+ app .Version = fmt . Sprintf ( "%s (%s)" , version .Version , version . GitCommit )
2020 cli .VersionPrinter = func (c * cli.Context ) {
2121 fmt .Printf ("%s version %s\n " , app .Name , app .Version )
2222 }
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ source $(dirname $0)/version.sh
55
66cd $( dirname $0 ) /..
77
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"
99STATIC=" -extldflags '-static'"
1010STATIC_SQLITE=" -extldflags '-static -lm -ldl -lz -lpthread'"
1111TAGS=" ctrd apparmor seccomp no_btrfs netgo osusergo"
You can’t perform that action at this time.
0 commit comments