mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-05-17 00:26:36 +03:00
### Describe Your Changes
The PR https://github.com/VictoriaMetrics/VictoriaMetrics/pull/9942 was
reverted in
c90c7c3123
because of the import cycle in the enterprise VM. Needs more work.
### Checklist
The following checks are **mandatory**:
- [ ] My change adheres to [VictoriaMetrics contributing
guidelines](https://docs.victoriametrics.com/victoriametrics/contributing/#pull-request-checklist).
- [ ] My change adheres to [VictoriaMetrics development
goals](https://docs.victoriametrics.com/victoriametrics/goals/).
18 lines
646 B
Go
18 lines
646 B
Go
package envflag
|
|
|
|
import "github.com/VictoriaMetrics/VictoriaMetrics/lib/flagutil"
|
|
|
|
// secretFlagsList contains names of flags with secret values obtained from
|
|
// the `-secret.flags` command-line option.
|
|
var secretFlagsList = flagutil.NewArrayString("secret.flags",
|
|
"Comma-separated list of flag names with secret values. Values for these flags are hidden in logs and on /metrics page")
|
|
|
|
// applySecretFlags registers flags from `-secret.flags` after they are parsed.
|
|
//
|
|
// The function must be called inside envflag.Parse after parsing flags.
|
|
func applySecretFlags() {
|
|
for _, f := range *secretFlagsList {
|
|
flagutil.RegisterSecretFlag(f)
|
|
}
|
|
}
|