Skip to content

Commit 5468a42

Browse files
committed
fix test
1 parent 7d7153a commit 5468a42

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

internal/adc/client/client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (d *Client) Insert(ctx context.Context, args Task) error {
7474

7575
func (d *Client) Remove(ctx context.Context, args Task) error {
7676
for _, config := range args.Configs {
77-
if err := d.Store.Delete(config.Name, args.ResourceTypes, args.Labels); err != nil {
77+
if err := d.Delete(config.Name, args.ResourceTypes, args.Labels); err != nil {
7878
log.Errorw("failed to delete resources from store",
7979
zap.String("name", config.Name),
8080
zap.Error(err),
@@ -102,7 +102,7 @@ func (c *Client) Sync(ctx context.Context, cfg map[string]adctypes.Config) (map[
102102
failedMap := map[string]types.ADCExecutionErrors{}
103103
var failedConfigs []string
104104
for name, config := range cfg {
105-
resources, err := c.Store.GetResources(name)
105+
resources, err := c.GetResources(name)
106106
if err != nil {
107107
log.Errorw("failed to get resources from store", zap.String("name", name), zap.Error(err))
108108
failedConfigs = append(failedConfigs, name)
@@ -183,7 +183,7 @@ func (c *Client) sync(ctx context.Context, task Task) error {
183183
resourceType = "all"
184184
}
185185

186-
err = c.executor.Execute(ctx, "", config, args)
186+
err = c.executor.Execute(ctx, c.BackendMode, config, args)
187187
duration := time.Since(startTime).Seconds()
188188

189189
status := "success"
@@ -231,7 +231,7 @@ func (c *Client) sync(ctx context.Context, task Task) error {
231231
resourceType = "all"
232232
}
233233

234-
err := c.executor.Execute(ctx, "", config, args)
234+
err := c.executor.Execute(ctx, c.BackendMode, config, args)
235235
duration := time.Since(startTime).Seconds()
236236

237237
status := "success"

internal/provider/api7ee/provider.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ type api7eeProvider struct {
5757

5858
provider.Options
5959

60-
configManager common.ConfigManager[adctypes.Config]
60+
configManager *common.ConfigManager[adctypes.Config]
6161

6262
client *adcclient.Client
6363
}
@@ -75,12 +75,13 @@ func New(updater status.Updater, readier readiness.ReadinessManager, opts ...pro
7575
}
7676

7777
return &api7eeProvider{
78-
client: cli,
79-
Options: o,
80-
translator: &translator.Translator{},
81-
updater: updater,
82-
readier: readier,
83-
syncCh: make(chan struct{}, 1),
78+
client: cli,
79+
Options: o,
80+
translator: &translator.Translator{},
81+
configManager: common.NewConfigManager[adctypes.Config](),
82+
updater: updater,
83+
readier: readier,
84+
syncCh: make(chan struct{}, 1),
8485
}, nil
8586
}
8687

internal/provider/apisix/provider.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ type apisixProvider struct {
5959

6060
syncCh chan struct{}
6161

62-
configManager common.ConfigManager[adctypes.Config]
62+
configManager *common.ConfigManager[adctypes.Config]
6363

6464
client *adcclient.Client
6565
}
@@ -77,12 +77,13 @@ func New(updater status.Updater, readier readiness.ReadinessManager, opts ...pro
7777
}
7878

7979
return &apisixProvider{
80-
client: cli,
81-
Options: o,
82-
translator: &translator.Translator{},
83-
updater: updater,
84-
readier: readier,
85-
syncCh: make(chan struct{}, 1),
80+
client: cli,
81+
Options: o,
82+
translator: &translator.Translator{},
83+
updater: updater,
84+
configManager: common.NewConfigManager[adctypes.Config](),
85+
readier: readier,
86+
syncCh: make(chan struct{}, 1),
8687
}, nil
8788
}
8889

0 commit comments

Comments
 (0)