Skip to content

Commit 5cfa08e

Browse files
authored
Merge pull request #138 from jingxu97/deleteTimestamp
Add the check for deleting snapshot while creating volume
2 parents 5c04206 + 2fac868 commit 5cfa08e

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
@@ -557,6 +557,9 @@ func (p *csiProvisioner) getVolumeContentSource(options controller.VolumeOptions
557557
return nil, fmt.Errorf("snapshot %s is not Ready", options.PVC.Spec.DataSource.Name)
558558
}
559559

560+
if snapshotObj.ObjectMeta.DeletionTimestamp != nil {
561+
return nil, fmt.Errorf("snapshot %s is currently being deleted", options.PVC.Spec.DataSource.Name)
562+
}
560563
glog.V(5).Infof("VolumeSnapshot %+v", snapshotObj)
561564

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

0 commit comments

Comments
 (0)