Skip to content

Commit

Permalink
describe rollback strategy in case of errors
Browse files Browse the repository at this point in the history
  • Loading branch information
iljarotar committed Sep 17, 2024
1 parent ca0a8c7 commit 3f0754b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cmd/metal-api/internal/service/switch-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,7 @@ func (r *switchResource) migrate(request *restful.Request, response *restful.Res

err = r.ds.UpdateSwitch(new, s)
if err != nil {
r.sendError(request, response, defaultError(err))
// TODO: should machine connections be rolled back in case of error
r.sendError(request, response, defaultError(fmt.Errorf("failed to migrate switch %s to %s but partial changes might have been written to the database. undo partial changes by migrating in the opposite direction. %w", old.ID, new.ID, err)))
return
}

Expand Down

0 comments on commit 3f0754b

Please sign in to comment.