[logcli] set default instead of error for parallel-max-workers validation (#8641)

**What this PR does / why we need it**:
Fixes regression reported here:
https://github.com/grafana/loki/pull/8518#issuecomment-1446014229

@dannykopping can you please verify that it fixes the issue for you?

**Checklist**
- [x] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [ ] Documentation added
- [ ] Tests updated
- [ ] `CHANGELOG.md` updated
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/upgrading/_index.md`
pull/8474/head
Angus Dippenaar 2 years ago committed by GitHub
parent 88120a0857
commit 5c5b27db50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      cmd/logcli/main.go

@ -428,12 +428,13 @@ func newQuery(instant bool, cmd *kingpin.CmdClause) *query.Query {
q.Start = mustParse(from, defaultStart)
q.End = mustParse(to, defaultEnd)
}
q.Quiet = *quiet
if q.ParallelMaxWorkers < 1 {
return fmt.Errorf("parallel-max-workers must be greater than 0")
if q.ParallelMaxWorkers < 1 {
log.Println("parallel-max-workers must be greater than 0, defaulting to 1.")
q.ParallelMaxWorkers = 1
}
}
q.Quiet = *quiet
return nil
})

Loading…
Cancel
Save