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

client: don't use Status RPC for Consul discovery (#16490) #16490

Merged
merged 7 commits into from
Mar 16, 2023

Commits on Mar 14, 2023

  1. client: use Status.RPCServers RPC for Consul discovery

    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.
    
    Create a new `Status.RPCServers` endpoint that mirrors the `Status.Peers`
    endpoint but provides the RPC server addresses instead of the Raft
    addresses. This fixes the authentication bug but also ensures we're only
    registering with servers in the client's region and not in any other servers
    that might have registered with Consul.
    
    This changeset also expands the test coverage of the RPC endpoint and closes up
    potential holes in the `ResolveACL` method that aren't currently bugs but easily
    could become bugs if we called the method without ensuring its invariants are
    upheld.
    
    Co-authored-by: tantra35 <ruslan.usifov@gmail.com>
    tgross and tantra35 committed Mar 14, 2023
    Configuration menu
    Copy the full SHA
    2bb67c3 View commit details
    Browse the repository at this point in the history

Commits on Mar 15, 2023

  1. Configuration menu
    Copy the full SHA
    21d9a4a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    094d3ba View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    25d0361 View commit details
    Browse the repository at this point in the history

Commits on Mar 16, 2023

  1. have registerNode handle NodeUpdateResponse

    We don't really have to worry about regions in the Consul discovery step. If we
    hit a different region and they're federated, the request will be forwarded. If
    the regions aren't federated (not a very safe topology in general), the node
    registration will fail and we'll retry.
    
    Eliminate the region tags we added to Consul. Have `registerNode` update the
    server list based on the response we get, and have it return the "no servers"
    error if we get no servers so that we kick off discovery again and retry
    immediately rather than 15s later.
    tgross committed Mar 16, 2023
    Configuration menu
    Copy the full SHA
    a7a6cdf View commit details
    Browse the repository at this point in the history
  2. back out changes to acl.go

    tgross committed Mar 16, 2023
    Configuration menu
    Copy the full SHA
    0a059cf View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    16fb6d5 View commit details
    Browse the repository at this point in the history