mirror of
https://git.vectorsigma.ru/public/k3s.git
synced 2026-08-05 14:59:51 +00:00
Signed-off-by: Derek Nola <derek.nola@suse.com>
This commit is contained in:
@@ -214,7 +214,7 @@ func NewAgentCommand(action func(ctx *cli.Context) error) cli.Command {
|
||||
Name: "agent",
|
||||
Usage: "Run node agent",
|
||||
UsageText: appName + " agent [OPTIONS]",
|
||||
Before: SetupDebug(CheckSELinuxFlags),
|
||||
Before: CheckSELinuxFlags,
|
||||
Action: action,
|
||||
Flags: []cli.Flag{
|
||||
ConfigFlag,
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
@@ -76,4 +77,7 @@ func setupLogging() {
|
||||
flag.Set("vmodule", LogConfig.VModule)
|
||||
flag.Set("alsologtostderr", strconv.FormatBool(Debug))
|
||||
flag.Set("logtostderr", strconv.FormatBool(!Debug))
|
||||
if Debug {
|
||||
logrus.SetLevel(logrus.DebugLevel)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import (
|
||||
"runtime"
|
||||
|
||||
"github.com/rancher/k3s/pkg/version"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
@@ -46,19 +45,6 @@ func NewApp() *cli.App {
|
||||
Usage: "(data) Folder to hold state default /var/lib/rancher/" + version.Program + " or ${HOME}/.rancher/" + version.Program + " if not root",
|
||||
},
|
||||
}
|
||||
app.Before = SetupDebug(nil)
|
||||
|
||||
return app
|
||||
}
|
||||
|
||||
func SetupDebug(next func(ctx *cli.Context) error) func(ctx *cli.Context) error {
|
||||
return func(ctx *cli.Context) error {
|
||||
if Debug {
|
||||
logrus.SetLevel(logrus.DebugLevel)
|
||||
}
|
||||
if next != nil {
|
||||
return next(ctx)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -498,7 +498,7 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command {
|
||||
Name: "server",
|
||||
Usage: "Run management server",
|
||||
UsageText: appName + " server [OPTIONS]",
|
||||
Before: SetupDebug(CheckSELinuxFlags),
|
||||
Before: CheckSELinuxFlags,
|
||||
Action: action,
|
||||
Flags: ServerFlags,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user