[MM-40712] config: Bugfix on path resolution; fail if given config does not exist (#19360)

* config: bugfix on path resolution; fail if given config does not exist

* reflect review comments

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2022-01-31 17:15:32 +03:00
коммит произвёл GitHub
родитель c554bbd977
Коммит e03384c4d1
12 изменённых файлов: 146 добавлений и 89 удалений

Просмотреть файл

@@ -68,7 +68,7 @@ func initDbCmdF(command *cobra.Command, _ []string) error {
return errors.Wrap(err, "error loading custom configuration defaults")
}
configStore, err := config.NewStoreFromDSN(getConfigDSN(command, config.GetEnvironment()), false, customDefaults)
configStore, err := config.NewStoreFromDSN(getConfigDSN(command, config.GetEnvironment()), false, customDefaults, true)
if err != nil {
return errors.Wrap(err, "failed to load configuration")
}

Просмотреть файл

@@ -49,7 +49,7 @@ func serverCmdF(command *cobra.Command, args []string) error {
mlog.Warn("Error loading custom configuration defaults: " + err.Error())
}
configStore, err := config.NewStoreFromDSN(getConfigDSN(command, config.GetEnvironment()), false, customDefaults)
configStore, err := config.NewStoreFromDSN(getConfigDSN(command, config.GetEnvironment()), false, customDefaults, true)
if err != nil {
return errors.Wrap(err, "failed to load configuration")
}