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

Gloo can't perform more than 2 transformations (HTTP filter) #4063

Closed
bcollard opened this issue Jan 6, 2021 · 4 comments
Closed

Gloo can't perform more than 2 transformations (HTTP filter) #4063

bcollard opened this issue Jan 6, 2021 · 4 comments
Labels
stale Issues that are stale. These will not be prioritized without further engagement on the issue. Type: Bug Something isn't working

Comments

@bcollard
Copy link
Contributor

bcollard commented Jan 6, 2021

Describe the bug
Gloo can't perform more than 2 transformations (HTTP filter).

In my context, I need to declare multiple transformations blocks, having different matchers (testing if different headers are present or not).
That's why I cannot merge these transformations under one single block.

To Reproduce
Steps to reproduce the behavior:

  1. kube apply '...'
kubectl apply -f - <<EOF
apiVersion: gateway.solo.io/v1
kind: VirtualService
metadata:
  name: httpbin-vs
  namespace: gloo-system
spec:
  virtualHost:
    domains:
      - '*'
    routes:
      - matchers:
          - prefix: /
        routeAction:
            single:
              upstream:
                name: default-httpbin-8000
                namespace: gloo-system
        options:
            stagedTransformations:
                regular:
                  requestTransforms:
                    - requestTransformation:
                        transformationTemplate:
                          passthrough: {}
                          headers:
                            x-custom-header-a:
                              text: "abc-def"
                      matcher:
                        prefix: /
                        headers:
                          - name: x-custom-header-a
                            invertMatch: true
                    - requestTransformation:
                        transformationTemplate:
                          passthrough: {}
                          headers:
                            x-custom-header-b:
                              text: "ghi-jkl"
                      matcher:
                        prefix: /
                        headers:
                          - name: x-custom-header-b
                            invertMatch: true
EOF
  1. curl -X GET $(glooctl proxy url --port http)/get
  2. only the 1st transformation is performed:
{
  "args": {},
  "headers": {
    "Accept": "*/*",
    "Content-Length": "0",
    "Host": "172.22.0.220",
    "User-Agent": "curl/7.64.1",
    "X-Custom-Header-A": "abc-def",
    "X-Envoy-Expected-Rq-Timeout-Ms": "15000"
  },
  "origin": "192.168.163.227",
  "url": "http://172.22.0.220/get"
}

Expected behavior
All of the transformation to be executed.

Additional context
It works with 2 transfo if I split them into the early stage and regular stage. But it won't work with more than 2 transfo.

  • Gloo Edge version: 1.5.14
  • Kubernetes version: 1.19
@bcollard bcollard added the Type: Bug Something isn't working label Jan 6, 2021
@bcollard
Copy link
Contributor Author

bcollard commented Jan 6, 2021

NOTE: the generated envoy config looks good but don't know how it's actually parsed by our Transformation filter:

"dynamic_route_configs": [
    {
     "version_info": "11860265109372557540",
     "route_config": {
      "@type": "type.googleapis.com/envoy.api.v2.RouteConfiguration",
      "name": "listener-::-8080-routes",
      "virtual_hosts": [
       {
        "name": "gloo-system_httpbin-vs",
        "domains": [
         "*"
        ],
        "routes": [
         {
          "match": {
           "prefix": "/"
          },
          "route": {
           "cluster": "default-httpbin-8000_gloo-system"
          },
          "typed_per_filter_config": {
           "io.solo.transformation": {
            "@type": "type.googleapis.com/envoy.api.v2.filter.http.RouteTransformations",
            "transformations": [
             {
              "request_match": {
               "match": {
                "prefix": "/",
                "headers": [
                 {
                  "name": "x-custom-header-a",
                  "present_match": true,
                  "invert_match": true
                 }
                ]
               },
               "request_transformation": {
                "transformation_template": {
                 "headers": {
                  "x-custom-header-a": {
                   "text": "abc-def"
                  }
                 },
                 "passthrough": {}
                }
               }
              }
             },
             {
              "request_match": {
               "match": {
                "prefix": "/",
                "headers": [
                 {
                  "name": "x-custom-header-b",
                  "present_match": true,
                  "invert_match": true
                 }
                ]
               },
               "request_transformation": {
                "transformation_template": {
                 "headers": {
                  "x-custom-header-b": {
                   "text": "ghi-jkl"
                  }
                 },
                 "passthrough": {}
                }
               }
              }
             }
            ]
           }
          }
         }
        ],

@murphye
Copy link
Contributor

murphye commented Jul 16, 2021

I also noticed this problem. It prevents using transformations with XSLT transformations for the same matcher. This can be problematic

Copy link

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.

@github-actions github-actions bot added the stale Issues that are stale. These will not be prioritized without further engagement on the issue. label Dec 15, 2023
Copy link

This issue has been closed due to no activity in the last 12 months.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issues that are stale. These will not be prioritized without further engagement on the issue. Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants