Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set container name empty when multiple containers don't specify ports #238

Merged
merged 3 commits into from
Jun 9, 2022

Conversation

dxsup
Copy link
Member

@dxsup dxsup commented Jun 6, 2022

Description

Set container name empty when multiple containers don't specify ports.

Motivation and Context

When there are multiple containers specified in one pod but they don't specify ports listened, we added them to the map using the combination of pod IP and port 0 as the key. This would cause us to find an incorrect container name using pod IP and the listening port. Since there is no method to find the exact container we want, I think we should set the container name to empty in case it makes the final result confusing.

Note that if there is only one container in the pod and it doesn't specify its port, we remain its name since no other containers confuse us.

Daxin Wang added 2 commits June 6, 2022 12:00
Signed-off-by: Daxin Wang <daxinwang@harmonycloud.cn>
Signed-off-by: Daxin Wang <daxinwang@harmonycloud.cn>
@dxsup dxsup requested a review from NeJan2020 June 6, 2022 08:03
Signed-off-by: Daxin Wang <daxinwang@harmonycloud.cn>
Copy link
Collaborator

@NeJan2020 NeJan2020 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix also influence ISSUE #239

@dxsup dxsup merged commit b62d2ab into KindlingProject:main Jun 9, 2022
@dxsup dxsup deleted the fix/incorrect-container branch June 9, 2022 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants