From e349f1eb3cc26a66309de6bbf3c1dc90dc9813ec Mon Sep 17 00:00:00 2001 From: l1b0k Date: Wed, 13 Nov 2024 21:34:59 +0800 Subject: [PATCH] fix tag filter Signed-off-by: l1b0k --- daemon/config.go | 1 + pkg/factory/aliyun/aliyun.go | 1 + types/config.go | 2 ++ 3 files changed, 4 insertions(+) diff --git a/daemon/config.go b/daemon/config.go index 8d987ff4..261efb11 100644 --- a/daemon/config.go +++ b/daemon/config.go @@ -49,6 +49,7 @@ func getENIConfig(cfg *daemon.Config) *types.ENIConfig { EniSelectionPolicy: eniSelectionPolicy, ResourceGroupID: cfg.ResourceGroupID, EniTypeAttr: 0, + TagFilter: cfg.ENITagFilter, } if cfg.VSwitches != nil { diff --git a/pkg/factory/aliyun/aliyun.go b/pkg/factory/aliyun/aliyun.go index c1cd0cd1..c3c0027c 100644 --- a/pkg/factory/aliyun/aliyun.go +++ b/pkg/factory/aliyun/aliyun.go @@ -73,6 +73,7 @@ func NewAliyun(ctx context.Context, openAPI *client.OpenAPI, getter eni.ENIInfoG eniTags: cfg.ENITags, eniTypeAttr: cfg.EniTypeAttr, selectionPolicy: cfg.VSwitchSelectionPolicy, + eniTagFilter: cfg.TagFilter, } } diff --git a/types/config.go b/types/config.go index b615b5c9..63f228c5 100644 --- a/types/config.go +++ b/types/config.go @@ -28,6 +28,8 @@ type ENIConfig struct { EnableIPv4 bool EnableIPv6 bool + + TagFilter map[string]string } // PoolConfig configuration of pool and resource factory