cleanup: do not panic on invalid drivername

When the cephcsi executable receives an error when calling
util.ValidateDriverName(), it panics due to klog.Fatalln(). The error
that util.ValidateDriverName() returns should be understandable enough,
so that users know what to investigate. A Go panic on a user error is
not very userfriendly, and does not provide any additional usefil
information.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2020-10-26 14:18:48 +01:00 committed by mergify[bot]
parent 79e91fa894
commit 23817c1a83

View File

@ -129,7 +129,7 @@ func main() {
dname := getDriverName()
err := util.ValidateDriverName(dname)
if err != nil {
klog.Fatalln(err) // calls exit
logAndExit(err.Error())
}
// the driver may need a higher PID limit for handling all concurrent requests