Skip to content

Commit d560388

Browse files
committed
fix: do not reset the clone and do not change the clone status if it is not started yet (#199)
1 parent e0dacf9 commit d560388

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/services/cloning/mode_base.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,17 +277,17 @@ func (c *baseCloning) ResetClone(cloneID string) error {
277277
return models.New(models.ErrCodeNotFound, "clone not found")
278278
}
279279

280+
if w.session == nil {
281+
return models.New(models.ErrCodeNotFound, "clone is not started yet")
282+
}
283+
280284
if err := c.updateCloneStatus(cloneID, models.Status{
281285
Code: models.StatusResetting,
282286
Message: models.CloneMessageResetting,
283287
}); err != nil {
284288
return errors.Wrap(err, "failed to update clone status")
285289
}
286290

287-
if w.session == nil {
288-
return models.New(models.ErrCodeNotFound, "clone is not started yet")
289-
}
290-
291291
go func() {
292292
err := c.provision.ResetSession(w.session, w.snapshot.ID)
293293
if err != nil {

0 commit comments

Comments
 (0)