Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/core/services/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -1219,8 +1219,8 @@ func (s *InstanceService) removeInstanceContainer(ctx context.Context, inst *dom
}

if err := s.compute.DeleteInstance(ctx, containerID); err != nil {
s.logger.Warn("failed to remove docker container", "container_id", containerID, "error", err)
return errors.Wrap(errors.Internal, "failed to remove container", err)
s.logger.Warn("failed to remove instance", "backend", s.compute.Type(), "id", containerID, "error", err)
return errors.Wrap(errors.Internal, fmt.Sprintf("failed to remove %s instance", s.compute.Type()), err)
}

s.logger.Info("instance terminated", "instance_id", inst.ID)
Expand Down
2 changes: 1 addition & 1 deletion internal/core/services/instance_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ func testInstanceServiceTerminateUnit(t *testing.T) {

err := svc.TerminateInstance(ctx, instanceID.String())
require.Error(t, err)
assert.Contains(t, err.Error(), "failed to remove container")
assert.Contains(t, err.Error(), "failed to remove docker instance")
mock.AssertExpectationsForObjects(t, repo, rbacSvc, compute)
})

Expand Down
Loading