Kong / datakit

A dataflow engine for request manipulation and aggregation
Apache License 2.0
3 stars 2 forks source link

fail open behavior observed for both debug and non-debug #19

Closed teb510 closed 3 months ago

teb510 commented 3 months ago

when using the below - the CALL fails but the upstream (httpbin) still serves the response - i noticed similar behavior when the template had an error as well. no error is returned on failure when debug is not set.

_format_version: "1.1"

services:
- name: demo
  url: https://not.a.url
  routes:
  - name: my-route
    paths:
    - /anything
    strip_path: false
    filter_chains:
    - filters:
      - name: datakit
        config:
          debug: true
          nodes:
          - name: FIRST
            type: call
            url: https://api.zippopotam.us/us/33162
          - inputs:
            - FIRST
            - request_headers
            name: JOIN
            output: RESP
            template: |
              {
                 "my_name": "{{ FIRST.country }"
              }
            type: template
          - inputs:
            - FIRST
            name: MY_HEADERS
            output: service_request_headers
            template: |
              {
                "Content-Type": "application/json",
                "X-Hello": "World",
                "X-Foo": "Bar",
                "X-Name": "{{ FIRST.country }}"
              }
            type: template
          - inputs:
            - FIRST
            name: MY_BODY
            output: service_request_body
            template: |
              {
                "derp": "{{ FIRST.country }}"
              }
            type: template
teb510 commented 3 months ago

the new release appears to fail closed @hishamhm - i will close.