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

connect: use stronger validation that ingress gateways have compatible protocols defined for their upstreams #8470

Merged
merged 7 commits into from
Aug 12, 2020

Commits on Aug 10, 2020

  1. connect: use stronger validation that ingress gateways have compatibl…

    …e protocols defined for their upstreams
    
    Fixes #8466
    
    Since Consul 1.8.0 there was a bug in how ingress gateway protocol
    compatibility was enforced. At the point in time that an ingress-gateway
    config entry was modified the discovery chain for each upstream was
    checked to ensure the ingress gateway protocol matched. Unfortunately
    future modifications of other config entries were not validated against
    existing ingress-gateway definitions, such as:
    
    1. create tcp ingress-gateway pointing to 'api' (ok)
    2. create service-defaults for 'api' setting protocol=http (worked, but not ok)
    3. create service-splitter or service-router for 'api' (worked, but caused an agent panic)
    
    If you were to do these in a different order, it would fail without a
    crash:
    
    1. create service-defaults for 'api' setting protocol=http (ok)
    2. create service-splitter or service-router for 'api' (ok)
    3. create tcp ingress-gateway pointing to 'api' (fail with message about
       protocol mismatch)
    
    This PR introduces the missing validation. The two new behaviors are:
    
    1. create tcp ingress-gateway pointing to 'api' (ok)
    2. (NEW) create service-defaults for 'api' setting protocol=http ("ok" for back compat)
    3. (NEW) create service-splitter or service-router for 'api' (fail with
       message about protocol mismatch)
    
    In consideration for any existing users that may be inadvertently be
    falling into item (2) above, that is now officiall a valid configuration
    to be in. For anyone falling into item (3) above while you cannot use
    the API to manufacture that scenario anymore, anyone that has old (now
    bad) data will still be able to have the agent use them just enough to
    generate a new agent/proxycfg error message rather than a panic.
    Unfortunately we just don't have enough information to properly fix the
    config entries.
    rboyer committed Aug 10, 2020
    Configuration menu
    Copy the full SHA
    bfc82e4 View commit details
    Browse the repository at this point in the history
  2. fix lint

    rboyer committed Aug 10, 2020
    Configuration menu
    Copy the full SHA
    c7b4a4e View commit details
    Browse the repository at this point in the history
  3. grammar

    rboyer committed Aug 10, 2020
    Configuration menu
    Copy the full SHA
    1328ddf View commit details
    Browse the repository at this point in the history
  4. stray comment

    rboyer committed Aug 10, 2020
    Configuration menu
    Copy the full SHA
    ced483f View commit details
    Browse the repository at this point in the history
  5. add test

    rboyer committed Aug 10, 2020
    Configuration menu
    Copy the full SHA
    54c765f View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2020

  1. prevent http->tcp

    rboyer committed Aug 11, 2020
    Configuration menu
    Copy the full SHA
    c73eb7c View commit details
    Browse the repository at this point in the history
  2. comment

    rboyer committed Aug 11, 2020
    Configuration menu
    Copy the full SHA
    903a127 View commit details
    Browse the repository at this point in the history