mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 02:50:30 +00:00
cephfs: skip expand for BackingSnapshot volume
We should not call ExpandVolume for the BackingSnapshot subvolume as there wont be any real subvolume created for it and even if we call it the ExpandVolume will fail fail as there is no real subvolume exists. This commits fixes by adjusting the `if` check to ensure that ExpandVolume will only be called either the VolumeRequest is to create from a snapshot or volume and BackingSnapshot is not true. sample code here https://go.dev/play/p/PI2tNii5tTg Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
019821a2c7
commit
f7796081d3
@ -315,7 +315,7 @@ func (cs *ControllerServer) CreateVolume(
|
||||
if vID != nil {
|
||||
volClient := core.NewSubVolume(volOptions.GetConnection(), &volOptions.SubVolume,
|
||||
volOptions.ClusterID, cs.ClusterName, cs.SetMetadata)
|
||||
if sID != nil || pvID != nil && !volOptions.BackingSnapshot {
|
||||
if (sID != nil || pvID != nil) && !volOptions.BackingSnapshot {
|
||||
err = volClient.ExpandVolume(ctx, volOptions.Size)
|
||||
if err != nil {
|
||||
purgeErr := volClient.PurgeVolume(ctx, false)
|
||||
|
Loading…
Reference in New Issue
Block a user