Skip to content

Commit 2fac868

Browse files
committed
Add the check for deleting snapshot while creating volume
If the snapshot is currently being deleted, the deletionTimestamp is set, and provisioner should not try to create the volume in this case.
1 parent accf345 commit 2fac868

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/controller/controller.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,9 @@ func (p *csiProvisioner) getVolumeContentSource(options controller.VolumeOptions
541541
return nil, fmt.Errorf("snapshot %s is not Ready", options.PVC.Spec.DataSource.Name)
542542
}
543543

544+
if snapshotObj.ObjectMeta.DeletionTimestamp != nil {
545+
return nil, fmt.Errorf("snapshot %s is currently being deleted", options.PVC.Spec.DataSource.Name)
546+
}
544547
glog.V(5).Infof("VolumeSnapshot %+v", snapshotObj)
545548

546549
snapContentObj, err := p.snapshotClient.VolumesnapshotV1alpha1().VolumeSnapshotContents().Get(snapshotObj.Spec.SnapshotContentName, metav1.GetOptions{})

0 commit comments

Comments
 (0)