Skip to content

Commit 137032c

Browse files
Merge pull request #3308 from medallia/add-crio-client-timeout
Add crio client timeout
2 parents 2e4a919 + fb569ce commit 137032c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

container/crio/client.go

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package crio
1717
import (
1818
"context"
1919
"encoding/json"
20+
"flag"
2021
"fmt"
2122
"io/ioutil"
2223
"net"
@@ -26,6 +27,8 @@ import (
2627
"time"
2728
)
2829

30+
var crioClientTimeout = flag.Duration("crio_client_timeout", time.Duration(0), "CRI-O client timeout. Default is no timeout.")
31+
2932
const (
3033
CrioSocket = "/var/run/crio/crio.sock"
3134
maxUnixSocketPathSize = len(syscall.RawSockaddrUnix{}.Path)
@@ -89,6 +92,7 @@ func Client() (CrioClient, error) {
8992
theClient = &crioClientImpl{
9093
client: &http.Client{
9194
Transport: tr,
95+
Timeout: *crioClientTimeout,
9296
},
9397
}
9498
})

0 commit comments

Comments
 (0)