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

Route Replacement does not work with UpstreamGroups #3818

Closed
lgadban opened this issue Nov 4, 2020 · 0 comments · Fixed by #3833
Closed

Route Replacement does not work with UpstreamGroups #3818

lgadban opened this issue Nov 4, 2020 · 0 comments · Fixed by #3833
Labels
Type: Bug Something isn't working

Comments

@lgadban
Copy link
Contributor

lgadban commented Nov 4, 2020

Describe the bug
Invalid route replacement does not work for routes that refer to a nonexistent UpstreamGroup

To Reproduce

  1. Create a route to refer to an UpstreamGroup and confirm it works
  2. Enable route replacement, e.g. --
    invalidConfigPolicy:
      invalidRouteResponseBody: Gloo Gateway has invalid configuration. Administrators
        should run `glooctl check` to find and fix config errors.
      invalidRouteResponseCode: 404
      replaceInvalidRoutes: true
  1. See error --
[2020-11-04 16:07:42.886][8][debug][misc] [external/envoy/source/common/protobuf/utility.cc:251] Proto validation error;
throwing Proto constraint validation failed (RouteConfigurationValidationError.VirtualHosts[i]: ["embedded message failed 
validation"] | caused by VirtualHostValidationError.Routes[i]: ["embedded message failed validation"] | caused by 
RouteValidationError.Route: ["embedded message failed validation"] | caused by field: "cluster_specifier", reason: is 
required): name: "listener-::-8080-routes"

followed by a dump of envoy config, specifically the route for the missing UpstreamGroup will be missing a cluster definition:

virtual_hosts {
  name: "gloo-system_petstore"
  domains: "*"
  routes {
    match {
      prefix: "/echo2"
    }
    route {
      prefix_rewrite: "/"
    }
  }
  routes {
    match {
      prefix: "/"
    }
    route {
      cluster: "default-petstore-8080_gloo-system"
    }
  }
  per_filter_config {
    key: "envoy.filters.http.ext_authz"
    value {
      fields {
        key: "disabled"
        value {
          bool_value: true
        }
      }
    }
  }
}

VirtualService snippet:

spec:
  virtualHost:
    domains:
    - '*'
    routes:
    - matchers:
      - prefix: /echo2
      options:
        prefixRewrite: /
      routeAction:
        upstreamGroup:
          name: my-service-group
          namespace: gloo-system
    - matchers:
      - prefix: /
      routeAction:
        single:
          upstream:
            name: default-petstore-8080
            namespace: gloo-system
status:
  reason: "warning: \n  Route Warning: InvalidDestinationWarning. Reason: *v1.UpstreamGroup
    {my-service-group gloo-system} not found\nRoute Warning: InvalidDestinationWarning.
    Reason: *v1.UpstreamGroup {my-service-group gloo-system} not found"
  reported_by: gateway
  state: 3
  subresource_statuses:
    '*v1.Proxy.gloo-system.gateway-proxy':
      reason: "warning: \n  Route Warning: InvalidDestinationWarning. Reason: *v1.UpstreamGroup
        {my-service-group gloo-system} not found\nRoute Warning: InvalidDestinationWarning.
        Reason: *v1.UpstreamGroup {my-service-group gloo-system} not found"
      reported_by: gloo
      state: 3

Expected behavior
Route replacement should work for UpstreamGroups

Additional context

% glooctl version
----------
glooctl binary version (1.5.3) differs from server components (v1.4.13) by at least a minor version.
Consider running:
glooctl upgrade --release=v1.4.13
----------

Client: {"version":"1.5.3"}
Server: {"type":"Gateway","enterprise":true,"kubernetes":{"containers":[{"Tag":"1.4.16","Name":"grpcserver-ui","Registry":"quay.io/solo-io"},{"Tag":"1.4.16","Name":"grpcserver-ee","Registry":"quay.io/solo-io"},{"Tag":"1.4.16","Name":"grpcserver-envoy","Registry":"quay.io/solo-io"},{"Tag":"1.4.13","Name":"discovery","Registry":"quay.io/solo-io"},{"Tag":"1.4.16","Name":"extauth-ee","Registry":"quay.io/solo-io"},{"Tag":"1.4.13","Name":"gateway","Registry":"quay.io/solo-io"},{"Tag":"1.4.16","Name":"gloo-ee-envoy-wrapper","Registry":"quay.io/solo-io"},{"Tag":"1.4.16","Name":"gloo-ee","Registry":"quay.io/solo-io"},{"Tag":"1.4.16","Name":"rate-limit-ee","Registry":"quay.io/solo-io"},{"Tag":"5","Name":"redis","Registry":"docker.io"}],"namespace":"gloo-system"}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant