bzp2010 opened a new issue, #2879:
URL: https://github.com/apache/apisix-ingress-controller/issues/2879

   ### Current Behavior
   
   `adc.Timeout` stores connect/read/send as `int`, so upstream timeouts are 
truncated to whole seconds during translation.
   
   - `ApisixUpstream` with `timeout.connect: 500ms` is sent as `connect: 0`. 
ADC rejects the configuration since every timeout has to be greater than 0, and 
because the whole GatewayProxy is pushed at once, nothing else under it gets 
synced until the value is changed.
   - `BackendTrafficPolicy` has the same problem with `0s`, which matches the 
CRD pattern `^[0-9]+s$` and is passed through as 0 without falling back to the 
default.
   - `ApisixRoute`'s `timeout` doesn't get rejected, but a sub-second value 
there silently becomes the 60s default for the same reason.
   
   The conversions are in `internal/adc/translator/apisixupstream.go`, 
`policies.go` and `apisixroute.go`.
   
   ### Expected Behavior
   
   Sub-second timeouts are sent as they are (the APISIX schema accepts 
decimals). A zero timeout either falls back to the default or is reported as 
invalid on the resource status instead of being sent.
   
   ### Error Logs
   
   ```
   HTTP 400: {"message":"Lint configuration\nThe following errors were found in 
configuration:","errors":[{"path":["services","[0]","upstream"],"message":"{... 
\"timeout\":{\"connect\":0.0,\"send\":1.0,\"read\":1.0} ...} is not valid under 
any of the schemas listed in the 'anyOf' keyword"}]}
   ```
   
   ### Steps to Reproduce
   
   1. Create an ApisixRoute with a backend Service, e.g. `httpbin`.
   2. Create an ApisixUpstream for that Service:
      ```yaml
      apiVersion: apisix.apache.org/v2
      kind: ApisixUpstream
      metadata:
        name: httpbin
      spec:
        timeout:
          connect: 500ms
          read: 1s
          send: 1s
      ```
   3. Every sync of that GatewayProxy now fails with the error above.
   
   ### Environment
   
   - APISIX Ingress controller: master
   - ADC: 0.30.5
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to