Add volumesnapshot content deletion policy
This PR adds DeletionPolicy which describes a policy for end-of-life maintenance of volume snapshot contents. There are two types of policies, delete and retain. By default, the policy is delete. In this case, when volume snaphsot is deleted, the volume snapshot content for it should be deleted, as well as the physical snapshot. If the policy is set the retain, the volume snapshot content will remain even if the volume snapshot it binds to is deleted.
This commit is contained in:
@@ -77,7 +77,7 @@ func (handler *csiHandler) DeleteSnapshot(content *crdv1.VolumeSnapshotContent,
|
||||
|
||||
err := handler.csiConnection.DeleteSnapshot(ctx, content.Spec.CSI.SnapshotHandle, snapshotterCredentials)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to delete snapshot data %s: %q", content.Name, err)
|
||||
return fmt.Errorf("failed to delete snapshot content %s: %q", content.Name, err)
|
||||
}
|
||||
|
||||
return nil
|
||||
@@ -92,7 +92,7 @@ func (handler *csiHandler) GetSnapshotStatus(content *crdv1.VolumeSnapshotConten
|
||||
|
||||
csiSnapshotStatus, timestamp, size, err := handler.csiConnection.GetSnapshotStatus(ctx, content.Spec.CSI.SnapshotHandle)
|
||||
if err != nil {
|
||||
return false, 0, 0, fmt.Errorf("failed to list snapshot data %s: %q", content.Name, err)
|
||||
return false, 0, 0, fmt.Errorf("failed to list snapshot content %s: %q", content.Name, err)
|
||||
}
|
||||
return csiSnapshotStatus, timestamp, size, nil
|
||||
|
||||
|
Reference in New Issue
Block a user