Skip to content

Commit 60360cf

Browse files
committed
fix: only keep the resource key label for filtering resources
Signed-off-by: Ashing Zheng <[email protected]>
1 parent 85e0406 commit 60360cf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/adc/client/client.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import (
3333

3434
adctypes "github.com/apache/apisix-ingress-controller/api/adc"
3535
"github.com/apache/apisix-ingress-controller/internal/adc/cache"
36+
"github.com/apache/apisix-ingress-controller/internal/controller/label"
3637
"github.com/apache/apisix-ingress-controller/internal/provider/common"
3738
"github.com/apache/apisix-ingress-controller/internal/types"
3839
pkgmetrics "github.com/apache/apisix-ingress-controller/pkg/metrics"
@@ -223,6 +224,11 @@ func (c *Client) Sync(ctx context.Context) (map[string]types.ADCExecutionErrors,
223224
func (c *Client) sync(ctx context.Context, task Task) error {
224225
log.Debugw("syncing resources", zap.Any("task", task))
225226

227+
if len(task.Labels) > 0 {
228+
// only keep the resource key label for filtering resources
229+
task.Labels = map[string]string{label.LabelResourceKey: task.Labels[label.LabelResourceKey]}
230+
}
231+
226232
if len(task.Configs) == 0 {
227233
log.Warnw("no adc configs provided", zap.Any("task", task))
228234
return nil

0 commit comments

Comments
 (0)