mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-27 16:50:23 +00:00
rbd: flatten image if the depth is not zero
flatten the image if the deep-flatten feature
is present on the images in the chain or if the
images in chain is not zero, as we cannot check
the deep-flatten feature the images which are
in trash.
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit 67d73cd6e9
)
This commit is contained in:
parent
38bd4e613e
commit
5e9f007ffd
@ -238,6 +238,7 @@ func (ns *NodeServer) stageTransaction(ctx context.Context, req *csi.NodeStageVo
|
|||||||
var err error
|
var err error
|
||||||
var readOnly bool
|
var readOnly bool
|
||||||
var feature bool
|
var feature bool
|
||||||
|
var depth uint
|
||||||
|
|
||||||
var cr *util.Credentials
|
var cr *util.Credentials
|
||||||
cr, err = util.NewUserCredentials(req.GetSecrets())
|
cr, err = util.NewUserCredentials(req.GetSecrets())
|
||||||
@ -272,7 +273,11 @@ func (ns *NodeServer) stageTransaction(ctx context.Context, req *csi.NodeStageVo
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return transaction, err
|
return transaction, err
|
||||||
}
|
}
|
||||||
if feature {
|
depth, err = volOptions.getCloneDepth(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return transaction, err
|
||||||
|
}
|
||||||
|
if feature || depth != 0 {
|
||||||
err = volOptions.flattenRbdImage(ctx, cr, true, rbdHardMaxCloneDepth, rbdSoftMaxCloneDepth)
|
err = volOptions.flattenRbdImage(ctx, cr, true, rbdHardMaxCloneDepth, rbdSoftMaxCloneDepth)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return transaction, err
|
return transaction, err
|
||||||
|
Loading…
Reference in New Issue
Block a user