Skip to content

Commit 56cf40e

Browse files
committed
feat: debug e2e failing
1 parent c77ce4d commit 56cf40e

2 files changed

Lines changed: 22 additions & 5 deletions

File tree

cmd/processor/handler.go

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,29 @@ func (h *processorHandler) processAllocation(req *allocationpb.AllocationRequest
239239

240240
resultObj, err := h.allocator.Allocate(h.ctx, gsa)
241241
if err != nil {
242-
return allocationResult{
243-
error: &rpcstatus.Status{
244-
Code: int32(codes.Internal),
245-
Message: fmt.Sprintf("Allocator error: %v", err),
242+
unallocated := &allocationv1.GameServerAllocation{
243+
Spec: gsa.Spec,
244+
Status: allocationv1.GameServerAllocationStatus{
245+
State: allocationv1.GameServerAllocationUnAllocated,
246246
},
247247
}
248+
response, convErr := converters.ConvertGSAToAllocationResponse(unallocated, h.grpcUnallocatedStatusCode)
249+
if convErr != nil {
250+
grpcStatus, ok := status.FromError(convErr)
251+
code := h.grpcUnallocatedStatusCode
252+
msg := convErr.Error()
253+
if ok {
254+
code = grpcStatus.Code()
255+
msg = grpcStatus.Message()
256+
}
257+
return allocationResult{
258+
error: &rpcstatus.Status{
259+
Code: int32(code),
260+
Message: msg,
261+
},
262+
}
263+
}
264+
return allocationResult{response: response}
248265
}
249266

250267
if s, ok := resultObj.(*metav1.Status); ok {

pkg/sdkserver/sdkserver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@ func (s *SDKServer) RemoveListValue(ctx context.Context, in *beta.RemoveListValu
12131213

12141214
// Track this removal for batch persistence to K8s
12151215
batchList := s.gsListUpdates[in.Name]
1216-
1216+
12171217
removedFromBatch := false
12181218
if len(batchList.valuesToAppend) > 0 {
12191219
newAppend := make([]string, 0, len(batchList.valuesToAppend))

0 commit comments

Comments
 (0)