mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-05 16:27:05 +00:00
nfd-worker: drop deprecated grpc.WithTimeout
This commit is contained in:
parent
91f3ddcc45
commit
c7b1d67b6b
1 changed files with 4 additions and 2 deletions
|
@ -188,7 +188,9 @@ func (w *nfdWorker) connect() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dial and create a client
|
// Dial and create a client
|
||||||
dialOpts := []grpc.DialOption{grpc.WithBlock(), grpc.WithTimeout(60 * time.Second)}
|
dialCtx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
dialOpts := []grpc.DialOption{grpc.WithBlock()}
|
||||||
if w.args.CaFile != "" || w.args.CertFile != "" || w.args.KeyFile != "" {
|
if w.args.CaFile != "" || w.args.CertFile != "" || w.args.KeyFile != "" {
|
||||||
// Load client cert for client authentication
|
// Load client cert for client authentication
|
||||||
cert, err := tls.LoadX509KeyPair(w.args.CertFile, w.args.KeyFile)
|
cert, err := tls.LoadX509KeyPair(w.args.CertFile, w.args.KeyFile)
|
||||||
|
@ -214,7 +216,7 @@ func (w *nfdWorker) connect() error {
|
||||||
} else {
|
} else {
|
||||||
dialOpts = append(dialOpts, grpc.WithInsecure())
|
dialOpts = append(dialOpts, grpc.WithInsecure())
|
||||||
}
|
}
|
||||||
conn, err := grpc.Dial(w.args.Server, dialOpts...)
|
conn, err := grpc.DialContext(dialCtx, w.args.Server, dialOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue