Skip to content

Commit

Permalink
Merge pull request #10276 from hashicorp/b-api-operator-query-meta
Browse files Browse the repository at this point in the history
api: set operator query meta

Set the query meta for LicenseGet request. It's expected by api consumers to determine the raft index.
  • Loading branch information
Mahmood Ali authored and schmichael committed May 14, 2021
1 parent 126de79 commit bcb3a9e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 8 additions & 4 deletions api/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ func (op *Operator) LicenseGet(q *QueryOptions) (*LicenseReply, *QueryMeta, erro
}

var reply LicenseReply
_, resp, err := op.c.doRequest(req)
rtt, resp, err := op.c.doRequest(req)
if err != nil {
return nil, nil, err
}
Expand All @@ -316,9 +316,13 @@ func (op *Operator) LicenseGet(q *QueryOptions) (*LicenseReply, *QueryMeta, erro
}

err = json.NewDecoder(resp.Body).Decode(&reply)
if err == nil {
return &reply, nil, nil
if err != nil {
return nil, nil, err
}

return nil, nil, err
qm := &QueryMeta{}
parseQueryMeta(resp, qm)
qm.RequestTime = rtt

return &reply, qm, nil
}
12 changes: 8 additions & 4 deletions vendor/github.com/hashicorp/nomad/api/operator.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bcb3a9e

Please sign in to comment.