apisix icon indicating copy to clipboard operation
apisix copied to clipboard

help request: can not create an ApisixPluginConfig of traffic-split

Open FIREcup opened this issue 1 year ago • 2 comments

Description

this is the ApisixPluginConfig yaml content:

apiVersion: apisix.apache.org/v2
kind: ApisixPluginConfig
metadata:
  name: test-traffic-split
  namespace: xiaom
spec:
  plugins:
  - name: traffic-split
    enable: true
    config:
      rules:
        - match:
            vars:
              - ["http_release", "==", "staging"]
          weighted_upstreams:
            - upstream:
                name: xiaom-svc2
                type: roundrobin
                nodes:
                  "[svc2.xiaom.svc.cluster.local:80](http://svc2.xiaom.svc.cluster.local/)": 10
              weight: 10

after I apply this yaml file, I see errors by describing the resource: unexpected status code 400; error message: {"error_msg":"invalid configuration: additional properties forbidden, found name"} Who know the reason?

Environment

  • APISIX version: 3.6.0

FIREcup avatar Jan 20 '25 07:01 FIREcup

could you reformat the config content? raw yaml in code block

wklken avatar Jan 20 '25 10:01 wklken

have modified the description. the root cause should be the APISIX version. I tried 3.7.0, and it works.

FIREcup avatar Jan 20 '25 10:01 FIREcup