emissary-ingress / emissary

open source Kubernetes-native API gateway for microservices built on the Envoy Proxy
https://www.getambassador.io
Apache License 2.0
4.37k stars 687 forks source link

Diagnostic flagging configuration error for AuthService when include_body.allow_partial: false #4222

Open junmcao opened 2 years ago

junmcao commented 2 years ago

Describe the bug Diagnostic flagging configuration error for AuthService when include_body.allow_partial: false with [auth.ambassador.1: spec.include_body.allow_partial in body is required] when include_body.allow_partial is set to false which is also the default.

To Reproduce Steps to reproduce the behavior: Configure an AuthService resource with include_body.allow_partial: false and deploy it.

apiVersion: getambassador.io/v3alpha1 kind: AuthService metadata: name: auth namespace: ambassador spec: auth_service: "127.0.0.1:8500" proto: grpc include_body: max_bytes: 1000001 allow_partial: false status_on_error: code: 403 failure_mode_allow: false

Expected behavior When include_body.allow_partial is false, it should not throw any errors about it not being set.

Versions (please complete the following information):

cindymullins-dw commented 2 years ago

Hi @juncao97, thanks for noting. For priority, is it interfering with functionality at all or just generating an error?

junmcao commented 2 years ago

Hi @cindymullins-dw, it seems to be interfering with functionality since I am unable to set it to false without that error showing up and when it is set to false it does not restrict the body byte size to what is specified. I set the include_body.max_bytes: 1 for testing and I did not receive a 413 error in response.

marianafranco commented 2 years ago

Any update on this? I'm trying to migrate from Ambassador 1.14 to Emissary-ingress 2.3.2 and having the same error when setting spec.include_body.allow_partial to false.

I noticed that allow_partial attribute is not returning when describing my AuthService. Is this a bug on the apiext?

marianafranco commented 1 year ago

I noticed that no error is returned on v3.4.1 and v3.7.2 when setting include_body.allow_partial: false.

However, the false value is not getting passed to envoy. Example:

my auth.yaml config:

apiVersion: getambassador.io/v3alpha1
kind: AuthService
...
spec:
  include_body:
      max_bytes: 1048576
      allow_partial: false

kubectl describe authservices.getambassador.io (no allow_partial is returned in the response):

include_body:
    max_bytes:       1048576

snapshots/snapshot.yaml file in the emissary pod:

"include_body": {
      "max_bytes": 1048576,
      "allow_partial": true
    },

envoy.envoy.json file in the emissary pod:

"with_request_body": {
     "allow_partial_message": true,
     "max_request_bytes": 1048576
}