fix: egress network governance plugin fails #1547
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
问题:使用出口网络治理插件时,如果组件 A 依赖组件 B ,且组件 B 有两个以上的端口打开了对内服务,如 8003 和 8004 端口,那么组件 A 仅访问组件 B 的 8003 端口时,将会轮询访问到组件 B 的两个端口上。但实际应该只访问到 8003 端口。
问题原因:内置治理模式调整成原生 service 后,一个 service 将会包含多个端口,导致端口重复处理。
解决方案:只获取对应端口的 endpoint 加入到 endpoints 列表中