-
Notifications
You must be signed in to change notification settings - Fork 187
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
Simple konn-client cleanups #343
Simple konn-client cleanups #343
Conversation
Hi @rata. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ok-to-test
/retest |
Tests are green now :) |
Friendly ping? :) |
@andrewsykim SGTM, thanks! |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale We are waiting for the release before moving with more changes. |
I'll rebase when there is a release and we can merge this (if that is the path agreed) |
cfbaca1
to
c83bb07
Compare
klog.V(1).InfoS("Tunnel has been closed; dropped", "connectionID", resp.ConnectID, "dialID", resp.Random) | ||
return | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add a line break after this line
t.conns.remove(resp.ConnectID) | ||
return | ||
if !ok { | ||
klog.V(1).InfoS("connection not recognized", "connectionID", resp.ConnectID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're making cosmetic changes here, can we start this log line with capitals (consistent with other log lines)
klog.V(1).InfoS("Tunnel has been closed, the grpc connection to the proxy server will be closed", "connectionID", conn.connID) | ||
} | ||
} else { | ||
if !ok { | ||
klog.V(1).InfoS("connection not recognized", "connectionID", resp.ConnectID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're making cosmetic changes here, can we start this log line with capitals (consistent with other log lines)
The else is pointless because the true branch has a return. Let's just remove the else and identation for better readability. There is no behavior change, this change is cosmetical.
Instead of having all the code inside an if, and outside just a log for the "uninteresting" case, let's just check if the conection is not recognize and remove the identation for the rest. There is no behavior change, this change is cosmetical. Signed-off-by: Rodrigo Campos <[email protected]>
Again, let's move the code out of the identation and just filter error cases out first. There is no behavior change, this change is cosmetical. Signed-off-by: Rodrigo Campos <[email protected]>
c83bb07
to
9f2918c
Compare
@andrewsykim Addressed your feedback. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cheftako, rata The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This PR doesn't make any behavior change, just cleans up the code to reduce unneeded indentations and just tries to filter out errors first for better readability.
If when you review this you think "hm, do we want to close the connection in this case instead of just continue on the loop?", I wonder the same and opened #338 to investigate that. This PR, though, is just making the current code more readable. The bugfix (if any ends up being needed) can be discussed in that issue.