@@ -186,21 +186,11 @@ func (d *adcClient) Update(ctx context.Context, tctx *provider.TranslateContext,
186186 }
187187 }
188188
189- switch d .BackendMode {
190- case BackendModeAPI7EE :
191- if apiv2 .Is (obj ) {
192- return nil
193- }
194- case BackendModeAPISIX :
195- // do nothing
196- case BackendModeAPISIXStandalone :
197- // This mode is full synchronization,
198- // which only needs to be saved in cache
199- // and triggered by a timer for synchronization
189+ // This mode is full synchronization,
190+ // which only needs to be saved in cache
191+ // and triggered by a timer for synchronization
192+ if d .BackendMode == BackendModeAPISIXStandalone || d .BackendMode == BackendModeAPISIX || apiv2 .Is (obj ) {
200193 return nil
201- default :
202- return errors .Errorf ("unknown backend mode: %s" , d .BackendMode )
203-
204194 }
205195
206196 return d .sync (ctx , Task {
@@ -260,7 +250,7 @@ func (d *adcClient) Delete(ctx context.Context, obj client.Object) error {
260250 log .Debugw ("successfully deleted resources from store" , zap .Any ("object" , obj ))
261251
262252 switch d .BackendMode {
263- case BackendModeAPISIXStandalone :
253+ case BackendModeAPISIXStandalone , BackendModeAPISIX :
264254 // Full synchronization is performed on a gateway by gateway basis
265255 // and it is not possible to perform scheduled synchronization
266256 // on deleted gateway level resources
@@ -271,7 +261,7 @@ func (d *adcClient) Delete(ctx context.Context, obj client.Object) error {
271261 })
272262 }
273263 return nil
274- case BackendModeAPI7EE , BackendModeAPISIX :
264+ case BackendModeAPI7EE :
275265 return d .sync (ctx , Task {
276266 Name : obj .GetName (),
277267 Labels : labels ,
0 commit comments