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

DNS lookup by Consul node ID #2702

Merged
merged 8 commits into from
Feb 2, 2017
Merged

DNS lookup by Consul node ID #2702

merged 8 commits into from
Feb 2, 2017

Commits on Feb 1, 2017

  1. Small premature optimization in isUUID().

    If the length isn't `36`, return `false` immediately before firing up
    the regexp engine.
    sean- committed Feb 1, 2017
    Configuration menu
    Copy the full SHA
    c5e140c View commit details
    Browse the repository at this point in the history
  2. Enable looking up consul nodes by their node ID.

    Assuming the following output from a consul agent:
    
    ```
    ==> Consul agent running!
               Version: 'v0.7.3-43-gc5e140c-dev (c5e140c+CHANGES)'
               Node ID: '40e4a748-2192-161a-0510-9bf59fe950b5'
             Node name: 'myhost'
    ```
    
    it is now possible to lookup nodes by their Node Name or Node ID, or a
    prefix match of the Node ID, with the following caveats re: the prefix
    match:
    
    1) first eight digits of the Node ID are a required minimum (eight was
       chosen as an arbitrary number)
    2) the length of the Node ID must be an even number or no result will be
       returned.
    
    ```
    % dig @127.0.0.1 -p 8600 myhost.node.dc1.consul.
    myhost.node.dc1.consul.	0	IN	A	127.0.0.1
    % dig @127.0.0.1 -p 8600 40e4a748-2192-161a-0510-9bf59fe950b5.node.dc1.consul.
    40e4a748-2192-161a-0510-9bf59fe950b5.node.dc1.consul. 0	IN A 127.0.0.1
    % dig @127.0.0.1 -p 8600 40e4a748.node.dc1.consul.
    40e4a748.node.dc1.consul. 0	IN	A	127.0.0.1
    % dig @127.0.0.1 -p 8600 40e4a74821.node.dc1.consul.
    40e4a74821.node.dc1.consul. 0	IN	A	127.0.0.1
    % dig @127.0.0.1 -p 8600 40e4a748-21.node.dc1.consul.
    40e4a748-21.node.dc1.consul. 0	IN	A	127.0.0.1
    ```
    sean- committed Feb 1, 2017
    Configuration menu
    Copy the full SHA
    f3f3f73 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    13fb395 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e86cefe View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    854f2b2 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    295ca81 View commit details
    Browse the repository at this point in the history
  7. Treat a uuid prefix lookup error as a soft error, as if a node name l…

    …ookup returned nil.
    
    Add a TODO to note where a future point of logging should occur once a
    logger is present.
    sean- committed Feb 1, 2017
    Configuration menu
    Copy the full SHA
    62527c1 View commit details
    Browse the repository at this point in the history

Commits on Feb 2, 2017

  1. Treat a uuid prefix lookup error as a soft error, as if a node name

    lookup returned nil.
    
    Add a TODO to note where a future point of logging should occur once a
    logger is present and a few additional comments to explain the program
    flow.
    sean- committed Feb 2, 2017
    Configuration menu
    Copy the full SHA
    c16f334 View commit details
    Browse the repository at this point in the history