Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
89f3fa3d
Commit
89f3fa3d
authored
Aug 24, 2018
by
fisherxu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use dailcontext
parent
f26556cc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
5 deletions
+17
-5
remote_image.go
pkg/kubelet/remote/remote_image.go
+5
-1
remote_runtime.go
pkg/kubelet/remote/remote_runtime.go
+4
-1
plugin_watcher.go
pkg/kubelet/util/pluginwatcher/plugin_watcher.go
+4
-2
grpc_service.go
...server/pkg/storage/value/encrypt/envelope/grpc_service.go
+4
-1
No files found.
pkg/kubelet/remote/remote_image.go
View file @
89f3fa3d
...
@@ -17,6 +17,7 @@ limitations under the License.
...
@@ -17,6 +17,7 @@ limitations under the License.
package
remote
package
remote
import
(
import
(
"context"
"errors"
"errors"
"fmt"
"fmt"
"time"
"time"
...
@@ -43,7 +44,10 @@ func NewRemoteImageService(endpoint string, connectionTimeout time.Duration) (in
...
@@ -43,7 +44,10 @@ func NewRemoteImageService(endpoint string, connectionTimeout time.Duration) (in
return
nil
,
err
return
nil
,
err
}
}
conn
,
err
:=
grpc
.
Dial
(
addr
,
grpc
.
WithInsecure
(),
grpc
.
WithTimeout
(
connectionTimeout
),
grpc
.
WithDialer
(
dailer
),
grpc
.
WithDefaultCallOptions
(
grpc
.
MaxCallRecvMsgSize
(
maxMsgSize
)))
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
connectionTimeout
)
defer
cancel
()
conn
,
err
:=
grpc
.
DialContext
(
ctx
,
addr
,
grpc
.
WithInsecure
(),
grpc
.
WithDialer
(
dailer
),
grpc
.
WithDefaultCallOptions
(
grpc
.
MaxCallRecvMsgSize
(
maxMsgSize
)))
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"Connect remote image service %s failed: %v"
,
addr
,
err
)
glog
.
Errorf
(
"Connect remote image service %s failed: %v"
,
addr
,
err
)
return
nil
,
err
return
nil
,
err
...
...
pkg/kubelet/remote/remote_runtime.go
View file @
89f3fa3d
...
@@ -45,7 +45,10 @@ func NewRemoteRuntimeService(endpoint string, connectionTimeout time.Duration) (
...
@@ -45,7 +45,10 @@ func NewRemoteRuntimeService(endpoint string, connectionTimeout time.Duration) (
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
conn
,
err
:=
grpc
.
Dial
(
addr
,
grpc
.
WithInsecure
(),
grpc
.
WithTimeout
(
connectionTimeout
),
grpc
.
WithDialer
(
dailer
),
grpc
.
WithDefaultCallOptions
(
grpc
.
MaxCallRecvMsgSize
(
maxMsgSize
)))
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
connectionTimeout
)
defer
cancel
()
conn
,
err
:=
grpc
.
DialContext
(
ctx
,
addr
,
grpc
.
WithInsecure
(),
grpc
.
WithDialer
(
dailer
),
grpc
.
WithDefaultCallOptions
(
grpc
.
MaxCallRecvMsgSize
(
maxMsgSize
)))
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"Connect remote runtime %s failed: %v"
,
addr
,
err
)
glog
.
Errorf
(
"Connect remote runtime %s failed: %v"
,
addr
,
err
)
return
nil
,
err
return
nil
,
err
...
...
pkg/kubelet/util/pluginwatcher/plugin_watcher.go
View file @
89f3fa3d
...
@@ -385,8 +385,10 @@ func (w *Watcher) notifyPlugin(client registerapi.RegistrationClient, registered
...
@@ -385,8 +385,10 @@ func (w *Watcher) notifyPlugin(client registerapi.RegistrationClient, registered
// Dial establishes the gRPC communication with the picked up plugin socket. https://godoc.org/google.golang.org/grpc#Dial
// Dial establishes the gRPC communication with the picked up plugin socket. https://godoc.org/google.golang.org/grpc#Dial
func
dial
(
unixSocketPath
string
,
timeout
time
.
Duration
)
(
registerapi
.
RegistrationClient
,
*
grpc
.
ClientConn
,
error
)
{
func
dial
(
unixSocketPath
string
,
timeout
time
.
Duration
)
(
registerapi
.
RegistrationClient
,
*
grpc
.
ClientConn
,
error
)
{
c
,
err
:=
grpc
.
Dial
(
unixSocketPath
,
grpc
.
WithInsecure
(),
grpc
.
WithBlock
(),
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
timeout
)
grpc
.
WithTimeout
(
timeout
),
defer
cancel
()
c
,
err
:=
grpc
.
DialContext
(
ctx
,
unixSocketPath
,
grpc
.
WithInsecure
(),
grpc
.
WithBlock
(),
grpc
.
WithDialer
(
func
(
addr
string
,
timeout
time
.
Duration
)
(
net
.
Conn
,
error
)
{
grpc
.
WithDialer
(
func
(
addr
string
,
timeout
time
.
Duration
)
(
net
.
Conn
,
error
)
{
return
net
.
DialTimeout
(
"unix"
,
addr
,
timeout
)
return
net
.
DialTimeout
(
"unix"
,
addr
,
timeout
)
}),
}),
...
...
staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service.go
View file @
89f3fa3d
...
@@ -59,7 +59,10 @@ func NewGRPCService(endpoint string) (Service, error) {
...
@@ -59,7 +59,10 @@ func NewGRPCService(endpoint string) (Service, error) {
return
nil
,
err
return
nil
,
err
}
}
connection
,
err
:=
grpc
.
Dial
(
addr
,
grpc
.
WithInsecure
(),
grpc
.
WithTimeout
(
timeout
),
grpc
.
WithDialer
(
unixDial
))
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
timeout
)
defer
cancel
()
connection
,
err
:=
grpc
.
DialContext
(
ctx
,
addr
,
grpc
.
WithInsecure
(),
grpc
.
WithDialer
(
unixDial
))
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"connect remote KMS provider %q failed, error: %v"
,
addr
,
err
)
return
nil
,
fmt
.
Errorf
(
"connect remote KMS provider %q failed, error: %v"
,
addr
,
err
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment