Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report faulting file when config reload fails #11304

Merged

Conversation

michalpristas
Copy link
Contributor

Modifying error output when reload config fails from

cfgfile/reload.go:213 Error loading config: invalid config: yaml: line 9: $err

to

cfgfile/reload.go:213 Error loading config from '<source>': $err

Fixes #8122

@michalpristas michalpristas requested a review from a team as a code owner March 19, 2019 11:34
@ph ph self-assigned this Mar 19, 2019
@ph ph self-requested a review March 19, 2019 19:03
@@ -35,6 +35,7 @@ import (
)

var (
// DefaultDynamicConfig provides default behavior for a Runner
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning up the godoc, can you add a dot after "Runner"?

@@ -220,7 +225,7 @@ func (rl *Reloader) loadConfigs(files []string) ([]*reload.ConfigWithMeta, error
configs, err := LoadList(file)
if err != nil {
errs = append(errs, err)
logp.Err("Error loading config: %s", err)
logp.Err("Error loading config from '%s': %v", file, err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably make a clear separation between the file and the error.

Error loading config from file '%s', error %v"

Copy link
Member

@ruflin ruflin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR LGTM, but could you rebase on master to get CI green and push again?

@michalpristas michalpristas merged commit 5de8ebb into elastic:master Mar 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants