tao12345666333 commented on code in PR #1056:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/1056#discussion_r950506354


##########
pkg/kube/apisix/apis/config/v2/types.go:
##########
@@ -236,6 +237,34 @@ type ApisixRouteStreamBackend struct {
        Subset string `json:"subset,omitempty" yaml:"subset,omitempty"`
 }
 
+// ApisixRouteStreamPlugin represents an APISIX strem plugin.
+type ApisixRouteStreamPlugin struct {
+       // The plugin name.
+       Name string `json:"name" yaml:"name"`
+       // Whether this plugin is in use, default is true.
+       Enable bool `json:"enable" yaml:"enable"`
+       // Plugin configuration.
+       Config ApisixRouteStreamPluginConfig `json:"config" yaml:"config"`
+}
+
+// ApisixRouteStreamPluginConfig is the configuration for
+// any stream plugins.
+type ApisixRouteStreamPluginConfig map[string]interface{}
+
+func (p ApisixRouteStreamPluginConfig) DeepCopyInto(out 
*ApisixRouteStreamPluginConfig) {
+       b, _ := json.Marshal(&p)
+       _ = json.Unmarshal(b, out)
+}
+
+func (p *ApisixRouteStreamPluginConfig) DeepCopy() 
*ApisixRouteStreamPluginConfig {
+       if p == nil {
+               return nil
+       }
+       out := new(ApisixRouteStreamPluginConfig)
+       p.DeepCopyInto(out)
+       return out
+}
+

Review Comment:
   I don't think it's necessary to introduce a new structure.
   In stream and http, the structure of the plugin is the same, and it will be 
the same in the future.
   
   We can easily rename `ApisixRouteHTTPPlugin` to `ApisixRoutePlugin`, what do 
you think?



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