mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 11:00:25 +00:00
cleanup: add logAndExit() for cephcsi:main() to call instead of panic
The main() function of the cephcsi executable calls klog.Fatalln() to report certain errors. This causes the executable to panic which is not helpful to users that only need the error message. By introducing logAndExit(), there is no need to call klog.Fatalln() anymore. Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
parent
9732cf16a1
commit
7101a6dc8e
@ -208,3 +208,8 @@ func validateMaxSnaphostFlag(conf *util.Config) {
|
|||||||
klog.Fatalln("maxsnapshotsonimage flag value should be between 1 and 500")
|
klog.Fatalln("maxsnapshotsonimage flag value should be between 1 and 500")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func logAndExit(msg string) {
|
||||||
|
klog.Errorln(msg)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user