mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 02:43:36 +00:00
cleanup: address gomnd warnings
Direct usage of numbers should be avoided. Issue reported: mnd: Magic number: X, in <argument> detected (gomnd) Signed-off-by: Yug <yuggupta27@gmail.com>
This commit is contained in:
@ -234,11 +234,13 @@ func (rv *rbdVolume) flattenCloneImage(ctx context.Context) error {
|
||||
// can flatten the parent images before use to avoid the stale omap entries.
|
||||
hardLimit := rbdHardMaxCloneDepth
|
||||
softLimit := rbdSoftMaxCloneDepth
|
||||
if rbdHardMaxCloneDepth < 2 {
|
||||
hardLimit = rbdHardMaxCloneDepth - 2
|
||||
// choosing 2 so that we don't need to flatten the image in the request.
|
||||
const depthToAvoidFlatten = 2
|
||||
if rbdHardMaxCloneDepth < depthToAvoidFlatten {
|
||||
hardLimit = rbdHardMaxCloneDepth - depthToAvoidFlatten
|
||||
}
|
||||
if rbdSoftMaxCloneDepth < 2 {
|
||||
softLimit = rbdSoftMaxCloneDepth - 2
|
||||
if rbdSoftMaxCloneDepth < depthToAvoidFlatten {
|
||||
softLimit = rbdSoftMaxCloneDepth - depthToAvoidFlatten
|
||||
}
|
||||
err := tempClone.getImageInfo()
|
||||
if err == nil {
|
||||
|
Reference in New Issue
Block a user