-
Notifications
You must be signed in to change notification settings - Fork 458
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
Fail to start server/agent on unknown config #1714
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It all looks good to me. I have only one suggestion.
l.WithFields(logrus.Fields{ | ||
"section": section, | ||
"keys": strings.Join(keys, ","), | ||
}).Error("Unknown configuration detected") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this effectively terminates the program, we may use the fatal level?
}).Error("Unknown configuration detected") | |
}).Fatal("Unknown configuration detected") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! Updated.
l.WithFields(logrus.Fields{ | ||
"section": section, | ||
"keys": strings.Join(keys, ","), | ||
}).Error("Unknown configuration detected") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this effectively terminates the program, we may use the fatal level?
}).Error("Unknown configuration detected") | |
}).Fatal("Unknown configuration detected") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! Updated.
@@ -24,6 +24,16 @@ func AssertLogs(t *testing.T, entries []*logrus.Entry, expected []LogEntry) { | |||
assert.Equal(t, expected, convertLogEntries(entries), "unexpected logs") | |||
} | |||
|
|||
func AssertLogsAnyOrder(t *testing.T, entries []*logrus.Entry, expected []LogEntry) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @azdagron!
Actually, we don't want Fatal. It calls os.Exit(). I'm going to change it back to Error level. I'll also squash and rebase. |
Also allows for consumers who are extending the CLI to opt-out of the unknown configuration check. Signed-off-by: Andrew Harding <andrew.harding@hpe.com>
e746a4c
to
91bc363
Compare
Also allows for consumers who are extending the CLI to opt-out of the unknown configuration check.
Fixes #1101, fixes #1432