mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 02:50:30 +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 {
|
} else {
|
||||||
util.DefaultLog("Initial PID limit is set to %d", currentLimit)
|
util.DefaultLog("Initial PID limit is set to %d", currentLimit)
|
||||||
err = util.SetPIDLimit(conf.PidLimit)
|
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)
|
klog.Errorf("Failed to set new PID limit to %d: %v", conf.PidLimit, err)
|
||||||
} else {
|
case conf.PidLimit == -1:
|
||||||
s := ""
|
util.DefaultLog("Reconfigured PID limit to %d (max)", conf.PidLimit)
|
||||||
if conf.PidLimit == -1 {
|
default:
|
||||||
s = " (max)"
|
util.DefaultLog("Reconfigured PID limit to %d", conf.PidLimit)
|
||||||
}
|
|
||||||
util.DefaultLog("Reconfigured PID limit to %d%s", conf.PidLimit, s)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user