-
Notifications
You must be signed in to change notification settings - Fork 141
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
Upgrade grpc-go dependency and check if file in SocketPath is actually a socket #126
Conversation
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Jiawei0227, msau42 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 |
pkg/util/util_linux.go
Outdated
if isSocket := (fi.Mode()&os.ModeSocket != 0); isSocket { | ||
return true, nil | ||
} | ||
klog.Warningf("file exists in socketPath %s but it's not a socket.: %+v", socketPath, fi) |
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.
Does this fix #104? It seems like this will return false
and nil
for the error if it is not a socket.
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.
Yeah good point... I initially return error but then wonder if it will break things so I change it to warning. I think an Error here seems okay to me? It's just we will have to change the CleanUpSocket function as well.
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.
I vaguely recall the socket checking logic differs between linux and Windows. It might be worth double-checking.
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.
There is already a TestSocketRegularFile which I modified a little bit that test this behavior.
The limitation is that we will have different behaviors on linux and windows... Because according golang/go#33357, windows socket file are not returning the right mode somehow... So the test will behavior a little bit different based on the two platforms.
Do we have a unit test that asserts we should return an error if the socket path exists but is not a socket file? |
/lgtm |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes # #104
Fixes # #93
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
/assign @chrishenzie
/cc @msau42