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

fingerprint: handle incomplete AWS imitation APIs #7509

Merged
merged 4 commits into from
Mar 26, 2020

Commits on Mar 26, 2020

  1. tests: Add tests for EC2 Metadata immitation cases

    Test that nomad doesn't set empty/bad network configuration when in an
    environment that does incomplete immitation of EC2 Metadata API.
    Mahmood Ali committed Mar 26, 2020
    Configuration menu
    Copy the full SHA
    500c3c2 View commit details
    Browse the repository at this point in the history
  2. fingerprint: handle incomplete AWS immitation APIs

    Fix a regression where we accidentally started treating non-AWS
    environments as AWS environments, resulting in bad networking settings.
    
    Two factors some at play:
    
    First, in [1], we accidentally switched the ultimate AWS test from
    checking `ami-id` to `instance-id`.  This means that nomad started
    treating more environments as AWS; e.g. Hetzner implements `instance-id`
    but not `ami-id`.
    
    Second, some of these environments return empty values instead of
    errors!  Hetzner returns empty 200 response for `local-ipv4`, resulting
    into bad networking configuration.
    
    This change fix the situation by restoring the check to `ami-id` and
    ensuring that we only set network configuration when the ip address is
    not-empty.  Also, be more defensive around response whitespace input.
    
    [1] #6779
    Mahmood Ali committed Mar 26, 2020
    Configuration menu
    Copy the full SHA
    e37f7af View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0c1dd0e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6199e96 View commit details
    Browse the repository at this point in the history