mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-10 15:14:09 +00:00
lib/envflag: do not allow unsupported form for boolean command-line flags in the form -boolFlag value
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4845
This commit is contained in:
parent
27f790458b
commit
a5df1e2525
2 changed files with 6 additions and 0 deletions
|
@ -15,6 +15,7 @@ The following tip changes can be tested by building VictoriaMetrics components f
|
|||
|
||||
## v1.87.x long-time support release (LTS)
|
||||
|
||||
* BUGFIX: do not allow starting VictoriaMetrics components with improperly set boolean command-line flags in the form `-boolFlagName value`, since this leads to silent incomplete flags' parsing. This form should be replaced with `-boolFlagName=value`. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4845).
|
||||
* BUGFIX: properly replace `:` chars in label names with `_` when `-usePromCompatibleNaming` command-line flag is passed to `vmagent`, `vminsert` or single-node VictoriaMetrics. This addresses [this comment](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3113#issuecomment-1275077071).
|
||||
* BUGFIX: [vmbackup](https://docs.victoriametrics.com/vmbackup.html): correctly check if specified `-dst` belongs to specified `-storageDataPath`. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4837).
|
||||
|
||||
|
|
|
@ -32,6 +32,11 @@ func ParseFlagSet(fs *flag.FlagSet, args []string) {
|
|||
// Do not use lib/logger here, since it is uninitialized yet.
|
||||
log.Fatalf("cannot parse flags %q: %s", args, err)
|
||||
}
|
||||
if fs.NArg() > 0 {
|
||||
// See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4845
|
||||
log.Fatalf("unprocessed command-line args left: %s; the most likely reason is missing `=` between boolean flag name and value; "+
|
||||
"see https://pkg.go.dev/flag#hdr-Command_line_flag_syntax", fs.Args())
|
||||
}
|
||||
if !*enable {
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue