mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #13581 from zexi/instance-snapshot-reset-validate
fix(region): instance snapshot reset should match self guest
This commit is contained in:
@@ -4790,6 +4790,10 @@ func (self *SGuest) PerformInstanceSnapshotReset(ctx context.Context, userCred m
|
||||
|
||||
instanceSnapshot := obj.(*SInstanceSnapshot)
|
||||
|
||||
if instanceSnapshot.GuestId != self.GetId() {
|
||||
return nil, httperrors.NewBadRequestError("instance snapshot %q not belong server %q", instanceSnapshot.GetName(), self.GetId())
|
||||
}
|
||||
|
||||
if instanceSnapshot.Status != api.INSTANCE_SNAPSHOT_READY {
|
||||
return nil, httperrors.NewBadRequestError("Instance sanpshot not ready")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user