mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 02:50:30 +00:00
cleanup: do not panic when validateMaxSnaphostFlag() detects an error
When the cephcsi executable detects an error when calling validateMaxSnaphostFlag(), it panics due to klog.Fatalln(). The error that validateMaxSnaphostFlag() logs 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:
parent
3e305970df
commit
4c91f07c78
@ -205,7 +205,7 @@ func validateMaxSnaphostFlag(conf *util.Config) {
|
||||
// [1] https://github.com/torvalds/linux/blob/master/drivers/block/rbd.c#L98
|
||||
// [2] https://github.com/torvalds/linux/blob/master/drivers/block/rbd.c#L92
|
||||
if conf.MaxSnapshotsOnImage == 0 || conf.MaxSnapshotsOnImage > 500 {
|
||||
klog.Fatalln("maxsnapshotsonimage flag value should be between 1 and 500")
|
||||
logAndExit("maxsnapshotsonimage flag value should be between 1 and 500")
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user