Disable reverting to a removed snapshot
Longhorn 3748
@@ -123,6 +123,9 @@ func (m *VolumeManager) RevertSnapshot(snapshotName, volumeName string) error {
if snapshot == nil {
return fmt.Errorf("not found snapshot '%s', for volume '%s'", snapshotName, volumeName)
}
+ if snapshot.Removed {
+ return fmt.Errorf("not revert to snapshot '%s' for volume '%s' since it's marked as Removed", snapshotName, volumeName)
+ }
if err := engine.SnapshotRevert(snapshotName); err != nil {
return err
}
