Skip to content

Commit

Permalink
fix params for Agent.Host client RPC
Browse files Browse the repository at this point in the history
The parameters for the receiving side of the Agent.Host client RPC did not
take the arguments serialized at the server side. This results in a panic.
  • Loading branch information
tgross committed Aug 31, 2020
1 parent 2740b48 commit 50ac77b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/agent_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ OUTER:
}

// Host collects data about the host evironment running the agent
func (a *Agent) Host(args *structs.QueryOptions, reply *structs.HostDataResponse) error {
func (a *Agent) Host(args *structs.HostDataRequest, reply *structs.HostDataResponse) error {
aclObj, err := a.c.ResolveToken(args.AuthToken)
if err != nil {
return err
Expand Down
8 changes: 5 additions & 3 deletions client/agent_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ func TestAgentHost(t *testing.T) {
})
defer cleanupC()

req := structs.QueryOptions{}
req := structs.HostDataRequest{}
var resp structs.HostDataResponse

err := c.ClientRPC("Agent.Host", &req, &resp)
Expand Down Expand Up @@ -420,8 +420,10 @@ func TestAgentHost_ACL(t *testing.T) {

for _, tc := range cases {
t.Run(tc.Name, func(t *testing.T) {
req := structs.QueryOptions{
AuthToken: tc.Token,
req := structs.HostDataRequest{
QueryOptions: structs.QueryOptions{
AuthToken: tc.Token,
},
}
var resp structs.HostDataResponse

Expand Down

0 comments on commit 50ac77b

Please sign in to comment.