Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
01b3bb31
Commit
01b3bb31
authored
Feb 07, 2019
by
Darren Shepherd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix version printing on startup
parent
56fae079
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
2 deletions
+6
-2
agent.go
pkg/cli/agent/agent.go
+4
-0
root.go
pkg/cli/cmds/root.go
+1
-1
build
scripts/build
+1
-1
No files found.
pkg/cli/agent/agent.go
View file @
01b3bb31
...
@@ -9,6 +9,7 @@ import (
...
@@ -9,6 +9,7 @@ import (
"github.com/rancher/k3s/pkg/cli/cmds"
"github.com/rancher/k3s/pkg/cli/cmds"
"github.com/rancher/norman/pkg/resolvehome"
"github.com/rancher/norman/pkg/resolvehome"
"github.com/rancher/norman/signal"
"github.com/rancher/norman/signal"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"github.com/urfave/cli"
)
)
...
@@ -25,6 +26,8 @@ func Run(ctx *cli.Context) error {
...
@@ -25,6 +26,8 @@ func Run(ctx *cli.Context) error {
return
fmt
.
Errorf
(
"--server is required"
)
return
fmt
.
Errorf
(
"--server is required"
)
}
}
logrus
.
Infof
(
"Starting k3s agent %s"
,
ctx
.
App
.
Version
)
dataDir
,
err
:=
resolvehome
.
Resolve
(
cmds
.
AgentConfig
.
DataDir
)
dataDir
,
err
:=
resolvehome
.
Resolve
(
cmds
.
AgentConfig
.
DataDir
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
...
@@ -35,5 +38,6 @@ func Run(ctx *cli.Context) error {
...
@@ -35,5 +38,6 @@ func Run(ctx *cli.Context) error {
cfg
.
DataDir
=
dataDir
cfg
.
DataDir
=
dataDir
contextCtx
:=
signal
.
SigTermCancelContext
(
context
.
Background
())
contextCtx
:=
signal
.
SigTermCancelContext
(
context
.
Background
())
return
agent
.
Run
(
contextCtx
,
cfg
)
return
agent
.
Run
(
contextCtx
,
cfg
)
}
}
pkg/cli/cmds/root.go
View file @
01b3bb31
...
@@ -16,7 +16,7 @@ func NewApp() *cli.App {
...
@@ -16,7 +16,7 @@ func NewApp() *cli.App {
app
:=
cli
.
NewApp
()
app
:=
cli
.
NewApp
()
app
.
Name
=
appName
app
.
Name
=
appName
app
.
Usage
=
"Kubernetes, but small and simple"
app
.
Usage
=
"Kubernetes, but small and simple"
app
.
Version
=
version
.
Version
app
.
Version
=
fmt
.
Sprintf
(
"%s (%s)"
,
version
.
Version
,
version
.
GitCommit
)
cli
.
VersionPrinter
=
func
(
c
*
cli
.
Context
)
{
cli
.
VersionPrinter
=
func
(
c
*
cli
.
Context
)
{
fmt
.
Printf
(
"%s version %s
\n
"
,
app
.
Name
,
app
.
Version
)
fmt
.
Printf
(
"%s version %s
\n
"
,
app
.
Name
,
app
.
Version
)
}
}
...
...
scripts/build
View file @
01b3bb31
...
@@ -5,7 +5,7 @@ source $(dirname $0)/version.sh
...
@@ -5,7 +5,7 @@ source $(dirname $0)/version.sh
cd
$(
dirname
$0
)
/..
cd
$(
dirname
$0
)
/..
LDFLAGS
=
"-X github.com/rancher/k3s/
version.Version=
$VERSION
-w -s"
LDFLAGS
=
"-X github.com/rancher/k3s/
pkg/version.Version=
$VERSION
-X github.com/rancher/k3s/pkg/version.GitCommit=
${
COMMIT
:0:8
}
-w -s"
STATIC
=
"-extldflags '-static'"
STATIC
=
"-extldflags '-static'"
STATIC_SQLITE
=
"-extldflags '-static -lm -ldl -lz -lpthread'"
STATIC_SQLITE
=
"-extldflags '-static -lm -ldl -lz -lpthread'"
TAGS
=
"ctrd apparmor seccomp no_btrfs netgo osusergo"
TAGS
=
"ctrd apparmor seccomp no_btrfs netgo osusergo"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment