Skip to content

Commit

Permalink
start to add unit test for control api
Browse files Browse the repository at this point in the history
Signed-off-by: Jordan Rash <jordan@synadia.com>
  • Loading branch information
jordan-rash committed Dec 27, 2024
1 parent c89cd77 commit 8b4770c
Show file tree
Hide file tree
Showing 5 changed files with 491 additions and 61 deletions.
7 changes: 4 additions & 3 deletions api/nodecontrol/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,14 @@ func (c *ControlAPIClient) DirectPing(nodeId string) (*nodegen.NodePingResponseJ
if err != nil {
return nil, err
}
resp := new(nodegen.NodePingResponseJson)
err = json.Unmarshal(msg.Data, resp)

envelope := new(models.Envelope[nodegen.NodePingResponseJson])
err = json.Unmarshal(msg.Data, envelope)
if err != nil {
return nil, err
}

return resp, nil
return &envelope.Data, nil
}

func (c *ControlAPIClient) FindWorkload(namespace, workloadId string) (*nodegen.WorkloadPingResponseJson, error) {
Expand Down
Loading

0 comments on commit 8b4770c

Please sign in to comment.