Skip to content

Commit dbccb4c

Browse files
authored
Merge pull request #723 from l1b0k/fix/tag_filter
fix tag filter
2 parents 74c47f3 + ba7b3ce commit dbccb4c

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

Diff for: daemon/config.go

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ func getENIConfig(cfg *daemon.Config) *types.ENIConfig {
4949
EniSelectionPolicy: eniSelectionPolicy,
5050
ResourceGroupID: cfg.ResourceGroupID,
5151
EniTypeAttr: 0,
52+
TagFilter: cfg.ENITagFilter,
5253
}
5354

5455
if cfg.VSwitches != nil {

Diff for: pkg/controller/multi-ip/node/pool.go

+6
Original file line numberDiff line numberDiff line change
@@ -1152,6 +1152,12 @@ func (n *ReconcileNode) createENI(ctx context.Context, node *networkv1beta1.Node
11521152
}
11531153
bo := backoff.Backoff(backoff.ENICreate)
11541154

1155+
tags := node.Spec.ENISpec.Tag
1156+
if tags == nil {
1157+
tags = map[string]string{}
1158+
}
1159+
// keep the ds behave
1160+
tags[types.NetworkInterfaceTagCreatorKey] = types.NetworkInterfaceTagCreatorValue
11551161
createOpts := &aliyunClient.CreateNetworkInterfaceOptions{
11561162
NetworkInterfaceOptions: &aliyunClient.NetworkInterfaceOptions{
11571163
VSwitchID: vsw.ID,

Diff for: pkg/factory/aliyun/aliyun.go

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ func NewAliyun(ctx context.Context, openAPI *client.OpenAPI, getter eni.ENIInfoG
7373
eniTags: cfg.ENITags,
7474
eniTypeAttr: cfg.EniTypeAttr,
7575
selectionPolicy: cfg.VSwitchSelectionPolicy,
76+
eniTagFilter: cfg.TagFilter,
7677
}
7778
}
7879

Diff for: types/config.go

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ type ENIConfig struct {
2828

2929
EnableIPv4 bool
3030
EnableIPv6 bool
31+
32+
TagFilter map[string]string
3133
}
3234

3335
// PoolConfig configuration of pool and resource factory

0 commit comments

Comments
 (0)