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

   # Summary
   
   When parsing comma-separated annotation values in the APISIX Ingress 
Controller, the implementation performs a simple `strings.Split(value, ",")` 
without trimming whitespace from the resulting elements. This causes leading or 
trailing spaces to be preserved in values following a comma.
   
   As a result, annotations that define multiple IP addresses fail if a space 
is included after the comma.
   
   ## Example
   
   If an annotation is defined as:
   `127.0.0.1, 0.0.0.0`
   After splitting on `,` the resulting values are:
   `["127.0.0.1", " 0.0.0.0"]`
   The second value contains a leading space, which causes IP validation to 
fail.
   
   ## Why This Is Problematic
   1. A space character is never valid in an IP address.
   2. Including a space after a comma is extremely common and idiomatic in 
programming and configuration formats.
   3. Users do not typically expect comma-separated configuration values to 
require manual whitespace management.
   4. This creates unnecessary fragility in configuration and leads to 
avoidable validation errors.
   
   ## Related snippet
   
https://github.com/apache/apisix-ingress-controller/blob/c48e9b3fb8d269b04b440c6fc5ed6880c05456f3/internal/adc/translator/annotations/types.go#L134
   
   # Proposed Resolution
   
   Either:
   1. Trim whitespace on each split element (preferred)
   or
   2. Explicitly document that whitespace is not allowed in comma-separated 
annotation values.
   
   ## Potential problems
   This splitting helper appears to be shared across annotations, so trimming 
would change parsing behavior globally.


-- 
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