Skip to content

Commit 15cd953

Browse files
committed
fix test
1 parent 9d6a60a commit 15cd953

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

internal/adc/cache/store.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ func (s *Store) Delete(name string, resourceTypes []string, Labels map[string]st
194194
if err != nil {
195195
log.Errorw("failed to list global rules", zap.Error(err))
196196
}
197+
log.Infow("deleting global rules", zap.Any("globalRules", globalRules))
197198
for _, globalRule := range globalRules {
198199
if err := targetCache.DeleteGlobalRule(globalRule); err != nil {
199200
log.Errorw("failed to delete global rule", zap.Error(err), zap.String("global rule", globalRule.ID))

internal/adc/client/client.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ func (d *Client) Update(ctx context.Context, args Task) error {
7070
d.mu.Lock()
7171
defer d.mu.Unlock()
7272
deleteConfigs := d.ConfigManager.Update(args.Key, args.Configs)
73+
d.ConfigManager.Delete(args.Key)
7374

7475
for _, config := range deleteConfigs {
7576
if err := d.Store.Delete(config.Name, args.ResourceTypes, args.Labels); err != nil {
@@ -109,7 +110,6 @@ func (d *Client) UpdateConfig(ctx context.Context, args Task) error {
109110
d.mu.Lock()
110111
defer d.mu.Unlock()
111112
deleteConfigs := d.ConfigManager.Update(args.Key, args.Configs)
112-
d.ConfigManager.Delete(args.Key)
113113

114114
for _, config := range deleteConfigs {
115115
if err := d.Store.Delete(config.Name, args.ResourceTypes, args.Labels); err != nil {
@@ -138,6 +138,7 @@ func (d *Client) Delete(ctx context.Context, args Task) error {
138138
defer d.mu.Unlock()
139139

140140
configs := d.ConfigManager.Get(args.Key)
141+
d.ConfigManager.Delete(args.Key)
141142

142143
for _, config := range configs {
143144
if err := d.Store.Delete(config.Name, args.ResourceTypes, args.Labels); err != nil {
@@ -160,7 +161,10 @@ func (d *Client) DeleteConfig(ctx context.Context, args Task) error {
160161
d.mu.Lock()
161162
defer d.mu.Unlock()
162163

163-
for _, config := range args.Configs {
164+
configs := d.ConfigManager.Get(args.Key)
165+
d.ConfigManager.Delete(args.Key)
166+
167+
for _, config := range configs {
164168
if err := d.Store.Delete(config.Name, args.ResourceTypes, args.Labels); err != nil {
165169
log.Errorw("failed to delete resources from store",
166170
zap.String("name", config.Name),

internal/provider/apisix/provider.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ func (d *apisixProvider) Delete(ctx context.Context, obj client.Object) error {
193193
}
194194
nnk := utils.NamespacedNameKind(obj)
195195

196-
log.Debugw("successfully deleted resources from store", zap.Any("object", obj))
197196
// Full synchronization is performed on a gateway by gateway basis
198197
// and it is not possible to perform scheduled synchronization
199198
// on deleted gateway level resources

0 commit comments

Comments
 (0)