Skip to content

Commit

Permalink
handle resolve unix addr error
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzhiquan committed Dec 24, 2020
1 parent dc2cb6c commit 84b5c55
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func main() {
func(ctx context.Context, s string) (net.Conn, error) {
unixAddr, err := net.ResolveUnixAddr("unix", defaultSocketPath)
if err != nil {
return nil, nil
return nil, fmt.Errorf("error while resolve unix addr:%w", err)
}
d := net.Dialer{}
return d.DialContext(ctx, "unix", unixAddr.String())
Expand Down
2 changes: 1 addition & 1 deletion plugin/terway/cni.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ func getNetworkClient() (rpc.TerwayBackendClient, func(), error) {
func(ctx context.Context, s string) (net.Conn, error) {
unixAddr, err := net.ResolveUnixAddr("unix", defaultSocketPath)
if err != nil {
return nil, nil
return nil, fmt.Errorf("error while resolve unix addr:%w", err)
}
d := net.Dialer{}
return d.DialContext(timeoutCtx, "unix", unixAddr.String())
Expand Down

0 comments on commit 84b5c55

Please sign in to comment.