Update to latest cadvisor - cleanup mesos/rkt

Change-Id: Ib5ae0cb13b93f8c87bb74e3ba33040df5f3d6a6f
This commit is contained in:
Davanum Srinivas
2019-04-09 13:11:33 -04:00
parent ca55432599
commit 70d562a6ac
143 changed files with 554 additions and 190406 deletions

View File

@@ -31,11 +31,6 @@ import (
"google.golang.org/grpc"
)
const (
// k8sNamespace is the namespace we use to connect containerd.
k8sNamespace = "k8s.io"
)
type client struct {
containerService containersapi.ContainersClient
taskService tasksapi.TasksClient
@@ -52,13 +47,12 @@ var once sync.Once
var ctrdClient containerdClient = nil
const (
address = "/run/containerd/containerd.sock"
maxBackoffDelay = 3 * time.Second
connectionTimeout = 2 * time.Second
)
// Client creates a containerd client
func Client() (containerdClient, error) {
func Client(address, namespace string) (containerdClient, error) {
var retErr error
once.Do(func() {
tryConn, err := net.DialTimeout("unix", address, connectionTimeout)
@@ -75,7 +69,7 @@ func Client() (containerdClient, error) {
grpc.WithBackoffMaxDelay(maxBackoffDelay),
grpc.WithTimeout(connectionTimeout),
}
unary, stream := newNSInterceptors(k8sNamespace)
unary, stream := newNSInterceptors(namespace)
gopts = append(gopts,
grpc.WithUnaryInterceptor(unary),
grpc.WithStreamInterceptor(stream),