do not exit if not specify labels in config
This commit is contained in:
parent
1373c1e828
commit
489d8df450
1 changed files with 6 additions and 9 deletions
|
@ -262,19 +262,16 @@ func registerNoInteractive(configFile string, regArgs *registerArgs) error {
|
|||
Labels: defaultLabels,
|
||||
}
|
||||
regArgs.Labels = strings.TrimSpace(regArgs.Labels)
|
||||
// command line flag.
|
||||
if regArgs.Labels != "" {
|
||||
inputs.Labels = strings.Split(regArgs.Labels, ",")
|
||||
}
|
||||
if configFile != "" {
|
||||
if len(cfg.Runner.Labels) > 0 {
|
||||
if regArgs.Labels != "" {
|
||||
log.Warn("Labels from command will be ignored, use labels defined in config file.")
|
||||
}
|
||||
inputs.Labels = cfg.Runner.Labels
|
||||
} else {
|
||||
log.Error("Please specify labels in config, and re-regitser.")
|
||||
return nil
|
||||
// specify labels in config file.
|
||||
if len(cfg.Runner.Labels) > 0 {
|
||||
if regArgs.Labels != "" {
|
||||
log.Warn("Labels from command will be ignored, use labels defined in config file.")
|
||||
}
|
||||
inputs.Labels = cfg.Runner.Labels
|
||||
}
|
||||
|
||||
if inputs.RunnerName == "" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue