@@ -123,51 +123,6 @@ type Route struct {
123123 FilterFunc string `json:"filter_func,omitempty" yaml:"filter_func,omitempty"`
124124}
125125
126- func (in * Route ) DeepCopyInto (out * Route ) {
127- * out = * in
128- out .Plugins = Plugins {}
129- in .Metadata .DeepCopyInto (& out .Metadata )
130- if in .Hosts != nil {
131- in , out := & in .Hosts , & out .Hosts
132- * out = make ([]string , len (* in ))
133- copy (* out , * in )
134- }
135- if in .Timeout != nil {
136- in , out := & in .Timeout , & out .Timeout
137- * out = new (UpstreamTimeout )
138- * * out = * * in
139- }
140- if in .Vars != nil {
141- in , out := & in .Vars , & out .Vars
142- * out = make (Vars , len (* in ))
143- for i := range * in {
144- if (* in )[i ] != nil {
145- in , out := & (* in )[i ], & (* out )[i ]
146- * out = make ([]StringOrSlice , len (* in ))
147- for i := range * in {
148- (* in )[i ].DeepCopyInto (& (* out )[i ])
149- }
150- }
151- }
152- }
153- if in .Uris != nil {
154- in , out := & in .Uris , & out .Uris
155- * out = make ([]string , len (* in ))
156- copy (* out , * in )
157- }
158- if in .Methods != nil {
159- in , out := & in .Methods , & out .Methods
160- * out = make ([]string , len (* in ))
161- copy (* out , * in )
162- }
163- if in .RemoteAddrs != nil {
164- in , out := & in .RemoteAddrs , & out .RemoteAddrs
165- * out = make ([]string , len (* in ))
166- copy (* out , * in )
167- }
168- in .Plugins .DeepCopyInto (& out .Plugins )
169- }
170-
171126// Vars represents the route match expressions of APISIX.
172127type Vars [][]StringOrSlice
173128
@@ -232,12 +187,12 @@ func (p *Plugins) DeepCopyInto(out *Plugins) {
232187 _ = json .Unmarshal (b , out )
233188}
234189
235- func (p * Plugins ) DeepCopy () * Plugins {
190+ func (p Plugins ) DeepCopy () Plugins {
236191 if p == nil {
237192 return nil
238193 }
239- out := new (Plugins )
240- p .DeepCopyInto (out )
194+ out := make (Plugins )
195+ p .DeepCopyInto (& out )
241196 return out
242197}
243198
@@ -532,37 +487,13 @@ type StreamRoute struct {
532487 Plugins Plugins `json:"plugins,omitempty" yaml:"plugins,omitempty"`
533488}
534489
535- func (in * StreamRoute ) DeepCopyInto (out * StreamRoute ) {
536- * out = * in
537- out .Plugins = Plugins {}
538- if in .Labels != nil {
539- in , out := & in .Labels , & out .Labels
540- * out = make (map [string ]string , len (* in ))
541- for key , val := range * in {
542- (* out )[key ] = val
543- }
544- }
545- if in .Upstream != nil {
546- in , out := & in .Upstream , & out .Upstream
547- * out = new (Upstream )
548- (* in ).DeepCopyInto (* out )
549- }
550- in .Plugins .DeepCopyInto (& out .Plugins )
551- }
552-
553490// GlobalRule represents the global_rule object in APISIX.
554491// +k8s:deepcopy-gen=true
555492type GlobalRule struct {
556493 ID string `json:"id" yaml:"id"`
557494 Plugins Plugins `json:"plugins" yaml:"plugins"`
558495}
559496
560- func (in * GlobalRule ) DeepCopyInto (out * GlobalRule ) {
561- * out = * in
562- out .Plugins = Plugins {}
563- in .Plugins .DeepCopyInto (& out .Plugins )
564- }
565-
566497// Consumer represents the consumer object in APISIX.
567498// +k8s:deepcopy-gen=true
568499type Consumer struct {
@@ -572,33 +503,13 @@ type Consumer struct {
572503 Plugins Plugins `json:"plugins,omitempty" yaml:"plugins,omitempty"`
573504}
574505
575- func (in * Consumer ) DeepCopyInto (out * Consumer ) {
576- * out = * in
577- out .Plugins = Plugins {}
578- if in .Labels != nil {
579- in , out := & in .Labels , & out .Labels
580- * out = make (map [string ]string , len (* in ))
581- for key , val := range * in {
582- (* out )[key ] = val
583- }
584- }
585- in .Plugins .DeepCopyInto (& out .Plugins )
586- }
587-
588506// PluginConfig apisix plugin object
589507// +k8s:deepcopy-gen=true
590508type PluginConfig struct {
591509 Metadata `json:",inline" yaml:",inline"`
592510 Plugins Plugins `json:"plugins" yaml:"plugins"`
593511}
594512
595- func (in * PluginConfig ) DeepCopyInto (out * PluginConfig ) {
596- * out = * in
597- out .Plugins = Plugins {}
598- in .Metadata .DeepCopyInto (& out .Metadata )
599- in .Plugins .DeepCopyInto (& out .Plugins )
600- }
601-
602513type PluginMetadata struct {
603514 Name string
604515 Metadata map [string ]any
0 commit comments