tzssangglass commented on issue #5607:
URL: https://github.com/apache/apisix/issues/5607#issuecomment-981285251


   I cannot reproduce your error on the master branch, here are the steps I 
took to reproduce it
   
   1. add upstream
   
   ```shell
   curl --location --request PUT 
'http://127.0.0.1:9080/apisix/admin/upstreams/100' \
   --header 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' \
   --header 'Content-Type: application/json' \
   --data-raw '{
       "type":"roundrobin",
       "nodes":{
           "httpbin.org:80": 1
       }
   }'
   ```
   
   2. add route
   
   ```shell
   curl --location --request PUT 'http://127.0.0.1:9080/apisix/admin/routes/1' \
   --header 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' \
   --header 'Content-Type: application/json' \
   --data-raw '{
       "plugins": {
           "traffic-split": {
               "rules": [
                   {
                       "match": [
                           {
                               "vars": [
                                   [
                                       "http_release",
                                       "==",
                                       "new_release"
                                   ]
                               ]
                           }
                       ],
                       "weighted_upstreams": [
                           {
                               "upstream_id": "100",
                               "weight": 2
                           },
                           {
                               "weight": 1
                           }
                       ]
                   }
               ]
           }
       },
       "upstream": {
           "nodes": {
               "127.0.0.1:1980": 1
           },
           "type": "roundrobin"
       },
       "uri": "/*"
   }'
   ```
   
   3. my backend 1980 is 
https://github.com/apache/apisix/blob/master/benchmark/server/conf/nginx.conf
   
   4. test
   
   ```
   curl http://127.0.0.1:9080/get -H 'release: new_release'
   ```
   
   5. no `attempt to index field 'upstream' (a string value) `in 
`logs/error.log`


-- 
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: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to