Skip to content

Commit a230d56

Browse files
committed
fix test
1 parent 605478e commit a230d56

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

internal/adc/client/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func (d *Client) Update(ctx context.Context, args Task) error {
8282
}
8383

8484
for _, config := range args.Configs {
85-
if err := d.Store.Insert(config.Name, args.ResourceTypes, args.Resources, args.Labels); err != nil {
85+
if err := d.Insert(config.Name, args.ResourceTypes, args.Resources, args.Labels); err != nil {
8686
log.Errorw("failed to insert resources into store",
8787
zap.String("name", config.Name),
8888
zap.Error(err),
@@ -121,7 +121,7 @@ func (d *Client) UpdateConfig(ctx context.Context, args Task) error {
121121
}
122122

123123
for _, config := range args.Configs {
124-
if err := d.Store.Insert(config.Name, args.ResourceTypes, args.Resources, args.Labels); err != nil {
124+
if err := d.Insert(config.Name, args.ResourceTypes, args.Resources, args.Labels); err != nil {
125125
log.Errorw("failed to insert resources into store",
126126
zap.String("name", config.Name),
127127
zap.Error(err),

internal/provider/api7ee/provider.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,8 @@ func (d *api7eeProvider) Start(ctx context.Context) error {
234234

235235
func (d *api7eeProvider) sync(ctx context.Context) error {
236236
statusesMap, err := d.client.Sync(ctx)
237-
if err != nil {
238-
return err
239-
}
240-
if statusesMap != nil {
241-
d.handleADCExecutionErrors(statusesMap)
242-
}
243-
return nil
237+
d.handleADCExecutionErrors(statusesMap)
238+
return err
244239
}
245240

246241
func (d *api7eeProvider) handleADCExecutionErrors(statusesMap map[string]types.ADCExecutionErrors) {

internal/provider/apisix/provider.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -262,13 +262,8 @@ func (d *apisixProvider) Start(ctx context.Context) error {
262262

263263
func (d *apisixProvider) sync(ctx context.Context) error {
264264
statusesMap, err := d.client.Sync(ctx)
265-
if err != nil {
266-
return err
267-
}
268-
if statusesMap != nil {
269-
d.handleADCExecutionErrors(statusesMap)
270-
}
271-
return nil
265+
d.handleADCExecutionErrors(statusesMap)
266+
return err
272267
}
273268

274269
func (d *apisixProvider) syncNotify() {

0 commit comments

Comments
 (0)