sandboxd: add Client.Info for GET /v1/info - #6
Merged
Conversation
The read-only twin of SetPools, so a node publisher can read warm-pool capacity through the operator's client instead of its own decoder.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
sandboxd.ClientreachesGET /v1/infoonly as the reply ofSetPools(PUT /v1/pools); there is no read-only call. vk-sandbox therefore keeps its ownsandboxdx.ListClientwith a private/v1/infodecoder next to the list call it already duplicates fromClient.Sandboxes. Giving the client anInfolets that package retire so the sandboxd wire contract has one home.Change
func (c *Client) Info(ctx) (*NodeInfo, error)—getJSON("/v1/info")into the existingNodeInfo(already documented as thePUT /v1/poolsandGET /v1/inforeply), authenticated with the node api token like every other node-level verb.TestInfodecodes a representative sandboxd reply (pools/claimed/hibernated/peers) and asserts the root-token header.Testing
go test ./pkg/scale/...green;make lintlinux + darwin0 issues;asl ./...clean.Follow-up in vk-sandbox: point
inventory.NodeInfoSourceandprovider.Listeratsandboxd.Client.Info/Client.Sandboxesand deletesandboxdx+provider.ListedSandbox.