From 86a8d29bd130d7c6809f4f51db35f9fe67fc2882 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Mon, 26 Oct 2020 14:18:48 +0100 Subject: [PATCH] cleanup: do not panic when the metricspath is not a valid URL When the cephcsi executable receives an error when calling util.ValidateURL() on the optional "metricspath". The error that util.ValidateURL() 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 --- cmd/cephcsi.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/cephcsi.go b/cmd/cephcsi.go index 22ab4a8e2..7ef318c5d 100644 --- a/cmd/cephcsi.go +++ b/cmd/cephcsi.go @@ -162,7 +162,7 @@ func main() { } err = util.ValidateURL(&conf) if err != nil { - klog.Fatalln(err) + logAndExit(err.Error()) } }