-
Notifications
You must be signed in to change notification settings - Fork 713
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
[tmpnet] Update URI and StakingAddress usage in support of kube #3665
Conversation
func GetLocalURI(tc tests.TestContext, node *tmpnet.Node) string { | ||
uri, cancel, err := node.GetLocalURI(tc.DefaultContext()) | ||
require.NoError(tc, err) | ||
tc.DeferCleanup(cancel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just invoke defer cancel() ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defer
would call it on function exit and then the caller wouldn't be able to use the URI. DeferCleanup
ensures it gets called when the test has completed and the caller doesn't need the URI anymore.
3a627fc
to
9adec71
Compare
Previously, Node.URI and Node.StakingAddress fields contained values for a local process and were always locally accessible. Nodes running in kubernetes may be running remotely, though, and only be accessible if e.g. a local port is forwarded to the port of a node's pod. To ensure compatibility with forwarded URIs and StakingAddresses, callers that aren't guaranteed to be running locally to a node are updated to access these values via functions that can ensure a remote endpoint is forwarded if the target node isn't running locally.
9adec71
to
665c75f
Compare
Rebased |
Why this should be merged
Previously,
Node.URI
andNode.StakingAddress
fields contained values for a local process and were always locally accessible. Nodes running in kubernetes may be running remotely, though, and only be accessible if e.g. a local port is forwarded to the port of a node's pod. To ensure compatibility with forwarded URIs and StakingAddresses, callers that aren't guaranteed to be running locally to a node are updated to access these values via functions that can ensure a remote endpoint is forwarded if the target node isn't running locally.How this was tested
CI
Need to be documented in RELEASES.md?
N/A
TODO
instance
label for logs and metrics #3650