Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

[Kube Runtime] Add port conflict check #3259

Merged
merged 3 commits into from
Jul 26, 2019
Merged

Conversation

abuccts
Copy link
Member

@abuccts abuccts commented Jul 25, 2019

Add port conflict check in runtime.

Add port conflict check in runtime.
@abuccts abuccts requested a review from wangdian July 25, 2019 10:11
@coveralls
Copy link

coveralls commented Jul 25, 2019

Coverage Status

Coverage remained the same at 50.399% when pulling be0263f on xiongyf/check-port into b28b21d on feature/pure-k8s.

abuccts added 2 commits July 25, 2019 19:15
Update.
Use regex to split.
portno: Port number to check.
"""
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
ret = sock.connect_ex(('localhost', portno))
Copy link
Member

@mzmssg mzmssg Jul 26, 2019

Choose a reason for hiding this comment

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

why not use sock.connect and catch exception

Copy link
Member Author

Choose a reason for hiding this comment

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

because there's a connect_ex function which returns C connect system call's error code

@abuccts abuccts merged commit 03fc241 into feature/pure-k8s Jul 26, 2019
@abuccts abuccts deleted the xiongyf/check-port branch July 26, 2019 04:30
@hzy46 hzy46 mentioned this pull request Apr 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants