Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: add missing AllocDirStats field in Go API #20261

Merged
merged 2 commits into from Apr 3, 2024
Merged

Conversation

tgross
Copy link
Member

@tgross tgross commented Apr 2, 2024

The JSON response for the Read Stats client API includes an AllocDirStats field. This field is missing in the api package, so consumers of the Go API can't use it to read the values we're getting back from the HTTP server.

Fixes: #20246

@tgross tgross added type/bug theme/api HTTP API and SDK issues theme/client backport/1.5.x backport to 1.5.x release line backport/1.6.x backport to 1.6.x release line backport/1.7.x backport to 1.7.x release line labels Apr 2, 2024
@tgross tgross added this to the 1.7.x milestone Apr 2, 2024
The JSON response for the Read Stats client API includes an `AllocDirStats`
field. This field is missing in the `api` package, so consumers of the Go API
can't use it to read the values we're getting back from the HTTP server.

Fixes: #20246
Copy link
Member

@gulducat gulducat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

.changelog/20261.txt Outdated Show resolved Hide resolved
c.DevMode = true
})
defer s.Stop()
nodesAPI := c.Nodes()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah this is one of those little "node" vs "client" battlegrounds, eh?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah c is the Go API client, and c.Nodes() is the Nodes API in the Go API client. 😀

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was more pointing out that it hits the /client API, not /node! looks like there's no client.go to have something like c.Clients() presumably to avoid the name collision of "Nomad client" and "Nomad API client" ... so the Nodes{} (go) API on the (go) API Client{} is used to hit both the /nodes (http) API and the /client (http) API 😅

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! Yeah, totally.

Co-authored-by: Daniel Bennett <dbennett@hashicorp.com>
@tgross tgross merged commit 78f9f17 into main Apr 3, 2024
15 of 16 checks passed
@tgross tgross deleted the api-missing-allocdir-stats branch April 3, 2024 12:54
philrenaud pushed a commit that referenced this pull request Apr 18, 2024
The JSON response for the Read Stats client API includes an `AllocDirStats`
field. This field is missing in the `api` package, so consumers of the Go API
can't use it to read the values we're getting back from the HTTP server.

Fixes: #20246
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.5.x backport to 1.5.x release line backport/1.6.x backport to 1.6.x release line backport/1.7.x backport to 1.7.x release line theme/api HTTP API and SDK issues theme/client type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AllocDirStats field missing from api definition of HostStats
3 participants