solo-io / gloo-portal-issues

Public tracker for issues related to Gloo Portal
https://docs.solo.io/gloo-portal/latest/
1 stars 3 forks source link

Portal routing fails with multi-version Environment #148

Closed jameshbarton closed 2 years ago

jameshbarton commented 2 years ago

Describe the bug Routing fails in Portal with some multi-version Environments. This case sets up an Environment with routes to an unsecured APIProduct with two versions, v1 and v2. They are identical except that v1 publishes all operations in its underlying APIDoc, and v2 publishes only 2 of those operations. The routing to v1 works fine when only v1 is included in the Environment. However, when both v1 and v2 are included, the routing to v2 works as expected, but v1 responds with a 404 error.

To Reproduce

  1. Unpack attached resources in routing-bug.tar.gz
  2. Install petstore service
    kubectl apply -f petstore-svc.yaml
  3. Install petstore APIDoc, APIProduct with both v1 and v2, and Environment.
    kubectl apply -f petstore-resources-0.yaml
  4. Confirm that v2 routing works as expected
    % curl -H "host: petstore.solo.io" $(glooctl proxy url)/v2/api/pets -i
    HTTP/1.1 200 OK
    content-type: application/xml
    date: Mon, 20 Dec 2021 22:23:38 GMT
    content-length: 86
    x-envoy-upstream-service-time: 1
    server: envoy
  5. Confirm that v1 route unexpectedly returns a 404
    % curl -H "host: petstore.solo.io" $(glooctl proxy url)/v1/api/pets -i
    HTTP/1.1 404 Not Found
    content-type: application/json
    date: Mon, 20 Dec 2021 22:23:33 GMT
    content-length: 56
    x-envoy-upstream-service-time: 0
    server: envoy
  6. Replace APIProduct so that it contains only v1
    kubectl apply -f petstore-resources-1.yaml
  7. Confirm that v1 routing now works as expected
    
    % curl -H "host: petstore.solo.io" $(glooctl proxy url)/v1/api/pets -i
    HTTP/1.1 200 OK
    content-type: application/xml
    date: Mon, 20 Dec 2021 22:23:52 GMT
    content-length: 86
    x-envoy-upstream-service-time: 0
    server: envoy

[{"id":1,"name":"Dog","status":"available"},{"id":2,"name":"Cat","status":"pending"}]



**Expected behavior**
Routing to either v1 or v2 when both are installed in APIProduct (at step 5) will succeed.

**Additional context**
Add any other context about the problem here, e.g.
- Gloo Portal version 1.1.2
- Gateway technology and version: Gloo Edge Enterprise v1.9.1
jameshbarton commented 2 years ago

Related Zendesk ticket: https://solo-io.zendesk.com/agent/tickets/456

bewebi commented 2 years ago

It appears that solo-io/dev-portal#2083 fixes the issue The fix is released in v1.2.0-beta2 onwards Can you and/or the customer confirm that a previous version was being used and/or that the bug is resolved when using more recent versions?

bewebi commented 2 years ago

It has been confirmed that this issue is fixed in the latest beta