Skip to content

Commit

Permalink
Prevent controller from crashing due to glog writing to /tmp (#1613)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessesuen authored Sep 21, 2019
1 parent 20e91ea commit a317fbf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 53 deletions.
41 changes: 4 additions & 37 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cmd/argoexec/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func init() {

func initConfig() {
cli.SetLogLevel(logLevel)
cli.SetGLogLevel(glogLevel)
}

func NewRootCommand() *cobra.Command {
Expand Down
1 change: 1 addition & 0 deletions cmd/workflow-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func NewRootCommand() *cobra.Command {
Short: "workflow-controller is the controller to operate on workflows",
RunE: func(c *cobra.Command, args []string) error {
cli.SetLogLevel(logLevel)
cli.SetGLogLevel(glogLevel)
stats.RegisterStackDumper()
stats.StartStatsTicker(5 * time.Minute)

Expand Down
16 changes: 0 additions & 16 deletions util/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,6 @@ func IsURL(u string) bool {
return false
}

// SetLogLevel sets the logrus logging level
func SetLogLevel(level string) {
switch strings.ToLower(level) {
case "debug":
log.SetLevel(log.DebugLevel)
case "info":
log.SetLevel(log.InfoLevel)
case "warn":
log.SetLevel(log.WarnLevel)
case "error":
log.SetLevel(log.ErrorLevel)
default:
log.Fatalf("Unknown level: %s", level)
}
}

// ParseLabels turns a string representation of a label set into a map[string]string
func ParseLabels(labelSpec interface{}) (map[string]string, error) {
labelString, isString := labelSpec.(string)
Expand Down

0 comments on commit a317fbf

Please sign in to comment.