From 8f7c2afc7894630e5a4574e5e8acc6c2f626127a 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 60750831..61de27c4 100644 --- a/daemon/config.go +++ b/daemon/config.go @@ -43,6 +43,7 @@ func getENIConfig(cfg *daemon.Config) *types.ENIConfig { VSwitchSelectionPolicy: policy, 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 a5688cef..5de58f59 100644 --- a/types/config.go +++ b/types/config.go @@ -19,6 +19,8 @@ type ENIConfig struct { EnableIPv4 bool EnableIPv6 bool + + TagFilter map[string]string } // PoolConfig configuration of pool and resource factory