Refactor startup deprecation messages (#30305)
It doesn't change logic, it only does: 1. Rename the variable and function names 2. Use more consistent format when mentioning config section&key 3. Improve some messages
This commit is contained in:
parent
48223909be
commit
bbe5cd7c92
11 changed files with 30 additions and 28 deletions
|
@ -235,9 +235,7 @@ var configuredPaths = make(map[string]string)
|
|||
func checkOverlappedPath(name, path string) {
|
||||
// TODO: some paths shouldn't overlap (storage.xxx.path), while some could (data path is the base path for storage path)
|
||||
if targetName, ok := configuredPaths[path]; ok && targetName != name {
|
||||
msg := fmt.Sprintf("Configured path %q is used by %q and %q at the same time. The paths must be unique to prevent data loss.", path, targetName, name)
|
||||
log.Error("%s", msg)
|
||||
DeprecatedWarnings = append(DeprecatedWarnings, msg)
|
||||
logStartupProblem(1, log.ERROR, "Configured path %q is used by %q and %q at the same time. The paths must be unique to prevent data loss.", path, targetName, name)
|
||||
}
|
||||
configuredPaths[path] = name
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue