rbd: remove unwanted condition check in flattenCloneImage

All the previous condition checks exit from the function and
when it reach to this block its obvious that error is non nil,
we dont need an extra check here.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
Humble Chirammal 2020-10-14 21:03:25 +05:30 committed by mergify[bot]
parent 5598c279da
commit 4cb7d2bbbd

View File

@ -244,10 +244,8 @@ func (rv *rbdVolume) flattenCloneImage(ctx context.Context) error {
if err == nil { if err == nil {
return tempClone.flattenRbdImage(ctx, tempClone.conn.Creds, false, hardLimit, softLimit) return tempClone.flattenRbdImage(ctx, tempClone.conn.Creds, false, hardLimit, softLimit)
} }
if err != nil {
if !errors.Is(err, ErrImageNotFound) { if !errors.Is(err, ErrImageNotFound) {
return err return err
} }
}
return rv.flattenRbdImage(ctx, rv.conn.Creds, false, hardLimit, softLimit) return rv.flattenRbdImage(ctx, rv.conn.Creds, false, hardLimit, softLimit)
} }