slime-io / slime

An intelligent ServiceMesh manager based on Istio
https://slime-io.github.io/
Other
427 stars 80 forks source link

plugin: applyInlinePlugin supports non-empty typeURL and nil settings #475

Closed YonkaFang closed 11 months ago

YonkaFang commented 11 months ago

对于一个plm插件:

  - enable: true
     listenerType: Gateway
     name: envoy.filters.http.cors.v3
     port: 8080
     typeUrl: type.googleapis.com/envoy.extensions.filters.http.cors.v3.Cors

之前: typeUrl不生效,因为typeUrl对于有效config才有意义所以原代码中要求inline不为空才能正确生成,也即上述内容需要加上

    inline: {}

才能正常工作。

之后: 对于该特殊场景(指定了typeUrl又并无实际内容需要设置),(不设置inline: {}就)可以正确生成对应配置

      operation: INSERT_BEFORE
      value:
        name: envoy.filters.http.cors.v3
        typed_config:
          '@type': type.googleapis.com/udpa.type.v1.TypedStruct
          type_url: type.googleapis.com/envoy.extensions.filters.http.cors.v3.Cors
          value: {}