mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
Merge pull request #8573 from deads2k/fix-check-err
tolerate fatals without newlines
This commit is contained in:
commit
49bf1ec0a1
@ -146,9 +146,13 @@ func messageForError(err error) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// fatal prints the message and then exits. If V(2) or greater, glog.Fatal
|
// fatal prints the message and then exits. If V(2) or greater, glog.Fatal
|
||||||
// is invoked for extended information. The provided msg should end in a
|
// is invoked for extended information.
|
||||||
// newline.
|
|
||||||
func fatal(msg string) {
|
func fatal(msg string) {
|
||||||
|
// add newline if needed
|
||||||
|
if !strings.HasSuffix(msg, "\n") {
|
||||||
|
msg += "\n"
|
||||||
|
}
|
||||||
|
|
||||||
if glog.V(2) {
|
if glog.V(2) {
|
||||||
glog.FatalDepth(2, msg)
|
glog.FatalDepth(2, msg)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user