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

Backport of client: don't use Status RPC for Consul discovery (#16490) into release/1.3.x #16568

Conversation

hc-github-team-nomad-core
Copy link
Contributor

Backport

This PR is auto-generated from #16490 to be assessed for backporting due to the inclusion of the label backport/1.3.x.

WARNING automatic cherry-pick of commits failed. Commits will require human attention.

The below text is copied from the body of the original PR.


Fixes #16470

In #16217 we switched clients using Consul discovery to the Status.Members
endpoint for getting the list of servers so that we're using the correct
address. This endpoint has an authorization gate, so this fails if the anonymous
policy doesn't have node:read. We also can't check the AuthToken for the
request for the client secret, because the client hasn't yet registered so the
server doesn't have anything to compare against.

Instead of hitting the Status.Peers or Status.Members RPC endpoint, use the
Consul response directly. Update the registerNode method to handle the list of
servers we get back in the response; if we get a "no servers" or "no path to
region" response we'll kick off discovery again and retry immediately rather
than waiting 15s.

@hc-github-team-nomad-core hc-github-team-nomad-core force-pushed the backport/client-access-to-status-members/logically-daring-ox branch from dc36ae0 to 372ca8b Compare March 20, 2023 17:04
@hashicorp-cla
Copy link

hashicorp-cla commented Mar 20, 2023

CLA assistant check
All committers have signed the CLA.

In #16217 we switched clients using Consul discovery to the `Status.Members`
endpoint for getting the list of servers so that we're using the correct
address. This endpoint has an authorization gate, so this fails if the anonymous
policy doesn't have `node:read`. We also can't check the `AuthToken` for the
request for the client secret, because the client hasn't yet registered so the
server doesn't have anything to compare against.

Instead of hitting the `Status.Peers` or `Status.Members` RPC endpoint, use the
Consul response directly. Update the `registerNode` method to handle the list of
servers we get back in the response; if we get a "no servers" or "no path to
region" response we'll kick off discovery again and retry immediately rather
than waiting 15s.
@tgross tgross force-pushed the backport/client-access-to-status-members/logically-daring-ox branch from 0191c87 to 08d3cfc Compare March 20, 2023 17:16
@tgross tgross merged commit cb40332 into release/1.3.x Mar 20, 2023
@tgross tgross deleted the backport/client-access-to-status-members/logically-daring-ox branch March 20, 2023 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants