Skip to content

Commit

Permalink
Return empty WorkflowContextList from GetWorkflowContextList
Browse files Browse the repository at this point in the history
Fixes #391
  • Loading branch information
swills committed Dec 30, 2021
1 parent b18b238 commit f340bb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion grpc-server/tinkerbell.go
Expand Up @@ -68,7 +68,8 @@ func (s *server) GetWorkflowContextList(ctx context.Context, req *pb.WorkflowCon
WorkflowContexts: wfContexts,
}, nil
}
return nil, nil

return &pb.WorkflowContextList{WorkflowContexts: []*pb.WorkflowContext{}}, nil
}

// GetWorkflowActions implements tinkerbell.GetWorkflowActions.
Expand Down
8 changes: 3 additions & 5 deletions grpc-server/tinkerbell_test.go
Expand Up @@ -135,13 +135,11 @@ func TestGetWorkflowContextList(t *testing.T) {
assert.True(t, tc.want.expectedError)
return
}
if err == nil && res == nil {
assert.False(t, tc.want.expectedError)
return
}
assert.NoError(t, err)
assert.NotNil(t, res)
assert.Len(t, res.WorkflowContexts, 1)
assert.False(t, tc.want.expectedError)
assert.IsType(t, &pb.WorkflowContextList{}, res)
assert.IsType(t, []*pb.WorkflowContext{}, res.WorkflowContexts)
})
}
}
Expand Down

0 comments on commit f340bb9

Please sign in to comment.