solo-io / gloo

The Feature-rich, Kubernetes-native, Next-Generation API Gateway Built on Envoy
https://docs.solo.io/
Apache License 2.0
4.08k stars 437 forks source link

Add ability to have dynamic `invalidRouteResponseBody` #7000

Open kevin-shelaga opened 2 years ago

kevin-shelaga commented 2 years ago

Version

1.11.x

Is your feature request related to a problem? Please describe.

It would be useful to have invalid config/replaced routes return information about the route being replaced.

https://docs.solo.io/gloo-edge/latest/guides/traffic_management/configuration_validation/invalid_route_replacement/

 gloo:
    invalidConfigPolicy:
      invalidRouteResponseBody: Gloo Edge has invalid configuration. Administrators
        should run `glooctl check` to find and fix config errors.
      invalidRouteResponseCode: 404
      replaceInvalidRoutes: true

Describe the solution you'd like

Perhaps something like:

 gloo:
    invalidConfigPolicy:
      invalidRouteResponseBody: Gloo Edge has invalid configuration. Administrators
        should run `glooctl check` to find and fix config errors.
      invalidRouteResponseCode: 404

      replaceInvalidRoutes: true

Describe alternatives you've considered

Perhaps something like:

 gloo:
    invalidConfigPolicy:
      invalidRouteResponseBody: Gloo Edge has invalid configuration. Administrators
        should run `glooctl check` to find and fix config errors.
      invalidRouteResponseCode: 404
      replaceInvalidRoutes: true
      dynamicErrorDetails: true <------

Then the response body could contain more details like:

ErrorCode: 0001 - Upstream couldn't find the service or ErrorCode: 0002 - Invalid Route Table, no Auth configuration found

Additional Context

No response

github-actions[bot] commented 3 months ago

This issue has been marked as stale because of no activity in the last 180 days. It will be closed in the next 180 days unless it is tagged "no stalebot" or other activity occurs.