fix params for Agent.Host client RPC (#8795)

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.
This commit is contained in:
Tim Gross 2020-08-31 17:14:26 -04:00 committed by GitHub
parent 71a694f39c
commit 8ad90b4253
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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)
@ -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