mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-17 20:00:23 +00:00
cleanup: refactor deeply nested if statement in cephcsi.go
Refactored deeply nested if statement in cephcsi.go to reduce cognitive complexity. Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
parent
aaeb35eceb
commit
7d105143fc
@ -148,14 +148,13 @@ func main() {
|
||||
} else {
|
||||
util.DefaultLog("Initial PID limit is set to %d", currentLimit)
|
||||
err = util.SetPIDLimit(conf.PidLimit)
|
||||
if err != nil {
|
||||
switch {
|
||||
case err != nil:
|
||||
klog.Errorf("Failed to set new PID limit to %d: %v", conf.PidLimit, err)
|
||||
} else {
|
||||
s := ""
|
||||
if conf.PidLimit == -1 {
|
||||
s = " (max)"
|
||||
}
|
||||
util.DefaultLog("Reconfigured PID limit to %d%s", conf.PidLimit, s)
|
||||
case conf.PidLimit == -1:
|
||||
util.DefaultLog("Reconfigured PID limit to %d (max)", conf.PidLimit)
|
||||
default:
|
||||
util.DefaultLog("Reconfigured PID limit to %d", conf.PidLimit)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user