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
09a38715
Commit
09a38715
authored
Oct 18, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15755 from zhengguoyong/del_capatical_packagename_for_cadvisorApi2
Auto commit by PR queue bot
parents
80838ff8
31c09bdc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
159 additions
and
159 deletions
+159
-159
cadvisor.go
contrib/mesos/pkg/executor/service/cadvisor.go
+2
-2
containerinfo.go
pkg/client/unversioned/containerinfo.go
+10
-10
containerinfo_test.go
pkg/client/unversioned/containerinfo_test.go
+15
-15
cadvisor_fake.go
pkg/kubelet/cadvisor/cadvisor_fake.go
+16
-16
cadvisor_linux.go
pkg/kubelet/cadvisor/cadvisor_linux.go
+12
-12
cadvisor_mock.go
pkg/kubelet/cadvisor/cadvisor_mock.go
+16
-16
cadvisor_unsupported.go
pkg/kubelet/cadvisor/cadvisor_unsupported.go
+12
-12
types.go
pkg/kubelet/cadvisor/types.go
+9
-9
docker_test.go
pkg/kubelet/dockertools/docker_test.go
+2
-2
fake_manager.go
pkg/kubelet/dockertools/fake_manager.go
+2
-2
manager.go
pkg/kubelet/dockertools/manager.go
+3
-3
manager_test.go
pkg/kubelet/dockertools/manager_test.go
+2
-2
kubelet.go
pkg/kubelet/kubelet.go
+6
-6
kubelet_test.go
pkg/kubelet/kubelet_test.go
+0
-0
cni_test.go
pkg/kubelet/network/cni/cni_test.go
+2
-2
oom_watcher.go
pkg/kubelet/oom_watcher.go
+3
-3
pod_workers_test.go
pkg/kubelet/pod_workers_test.go
+3
-3
runonce_test.go
pkg/kubelet/runonce_test.go
+2
-2
server.go
pkg/kubelet/server.go
+7
-7
server_test.go
pkg/kubelet/server_test.go
+27
-27
util.go
pkg/kubelet/util.go
+2
-2
kubelet_stats.go
test/e2e/kubelet_stats.go
+6
-6
No files found.
contrib/mesos/pkg/executor/service/cadvisor.go
View file @
09a38715
...
...
@@ -19,7 +19,7 @@ package service
import
(
"k8s.io/kubernetes/pkg/kubelet/cadvisor"
cadvisor
A
pi
"github.com/google/cadvisor/info/v1"
cadvisor
a
pi
"github.com/google/cadvisor/info/v1"
)
type
MesosCadvisor
struct
{
...
...
@@ -36,7 +36,7 @@ func NewMesosCadvisor(cores int, mem int64, port uint) (*MesosCadvisor, error) {
return
&
MesosCadvisor
{
c
,
cores
,
mem
},
nil
}
func
(
mc
*
MesosCadvisor
)
MachineInfo
()
(
*
cadvisor
A
pi
.
MachineInfo
,
error
)
{
func
(
mc
*
MesosCadvisor
)
MachineInfo
()
(
*
cadvisor
a
pi
.
MachineInfo
,
error
)
{
mi
,
err
:=
mc
.
Interface
.
MachineInfo
()
if
err
!=
nil
{
return
nil
,
err
...
...
pkg/client/unversioned/containerinfo.go
View file @
09a38715
...
...
@@ -25,16 +25,16 @@ import (
"net/http"
"strconv"
cadvisor
A
pi
"github.com/google/cadvisor/info/v1"
cadvisor
a
pi
"github.com/google/cadvisor/info/v1"
)
type
ContainerInfoGetter
interface
{
// GetContainerInfo returns information about a container.
GetContainerInfo
(
host
,
podID
,
containerID
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
*
cadvisorA
pi
.
ContainerInfo
,
error
)
GetContainerInfo
(
host
,
podID
,
containerID
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
*
cadvisora
pi
.
ContainerInfo
,
error
)
// GetRootInfo returns information about the root container on a machine.
GetRootInfo
(
host
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
*
cadvisorA
pi
.
ContainerInfo
,
error
)
GetRootInfo
(
host
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
*
cadvisora
pi
.
ContainerInfo
,
error
)
// GetMachineInfo returns the machine's information like number of cores, memory capacity.
GetMachineInfo
(
host
string
)
(
*
cadvisor
A
pi
.
MachineInfo
,
error
)
GetMachineInfo
(
host
string
)
(
*
cadvisor
a
pi
.
MachineInfo
,
error
)
}
type
HTTPContainerInfoGetter
struct
{
...
...
@@ -42,7 +42,7 @@ type HTTPContainerInfoGetter struct {
Port
int
}
func
(
self
*
HTTPContainerInfoGetter
)
GetMachineInfo
(
host
string
)
(
*
cadvisor
A
pi
.
MachineInfo
,
error
)
{
func
(
self
*
HTTPContainerInfoGetter
)
GetMachineInfo
(
host
string
)
(
*
cadvisor
a
pi
.
MachineInfo
,
error
)
{
request
,
err
:=
http
.
NewRequest
(
"GET"
,
fmt
.
Sprintf
(
"http://%v/spec"
,
...
...
@@ -63,7 +63,7 @@ func (self *HTTPContainerInfoGetter) GetMachineInfo(host string) (*cadvisorApi.M
return
nil
,
fmt
.
Errorf
(
"trying to get machine spec from %v; received status %v"
,
host
,
response
.
Status
)
}
var
minfo
cadvisor
A
pi
.
MachineInfo
var
minfo
cadvisor
a
pi
.
MachineInfo
err
=
json
.
NewDecoder
(
response
.
Body
)
.
Decode
(
&
minfo
)
if
err
!=
nil
{
return
nil
,
err
...
...
@@ -71,7 +71,7 @@ func (self *HTTPContainerInfoGetter) GetMachineInfo(host string) (*cadvisorApi.M
return
&
minfo
,
nil
}
func
(
self
*
HTTPContainerInfoGetter
)
getContainerInfo
(
host
,
path
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
*
cadvisorA
pi
.
ContainerInfo
,
error
)
{
func
(
self
*
HTTPContainerInfoGetter
)
getContainerInfo
(
host
,
path
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
*
cadvisora
pi
.
ContainerInfo
,
error
)
{
var
body
io
.
Reader
if
req
!=
nil
{
content
,
err
:=
json
.
Marshal
(
req
)
...
...
@@ -102,7 +102,7 @@ func (self *HTTPContainerInfoGetter) getContainerInfo(host, path string, req *ca
return
nil
,
fmt
.
Errorf
(
"trying to get info for %v from %v; received status %v"
,
path
,
host
,
response
.
Status
)
}
var
cinfo
cadvisor
A
pi
.
ContainerInfo
var
cinfo
cadvisor
a
pi
.
ContainerInfo
err
=
json
.
NewDecoder
(
response
.
Body
)
.
Decode
(
&
cinfo
)
if
err
!=
nil
{
return
nil
,
err
...
...
@@ -110,7 +110,7 @@ func (self *HTTPContainerInfoGetter) getContainerInfo(host, path string, req *ca
return
&
cinfo
,
nil
}
func
(
self
*
HTTPContainerInfoGetter
)
GetContainerInfo
(
host
,
podID
,
containerID
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
*
cadvisorA
pi
.
ContainerInfo
,
error
)
{
func
(
self
*
HTTPContainerInfoGetter
)
GetContainerInfo
(
host
,
podID
,
containerID
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
*
cadvisora
pi
.
ContainerInfo
,
error
)
{
return
self
.
getContainerInfo
(
host
,
fmt
.
Sprintf
(
"%v/%v"
,
podID
,
containerID
),
...
...
@@ -118,6 +118,6 @@ func (self *HTTPContainerInfoGetter) GetContainerInfo(host, podID, containerID s
)
}
func
(
self
*
HTTPContainerInfoGetter
)
GetRootInfo
(
host
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
*
cadvisorA
pi
.
ContainerInfo
,
error
)
{
func
(
self
*
HTTPContainerInfoGetter
)
GetRootInfo
(
host
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
*
cadvisora
pi
.
ContainerInfo
,
error
)
{
return
self
.
getContainerInfo
(
host
,
""
,
req
)
}
pkg/client/unversioned/containerinfo_test.go
View file @
09a38715
...
...
@@ -28,13 +28,13 @@ import (
"testing"
"time"
cadvisor
A
pi
"github.com/google/cadvisor/info/v1"
cadvisor
ApiT
est
"github.com/google/cadvisor/info/v1/test"
cadvisor
a
pi
"github.com/google/cadvisor/info/v1"
cadvisor
apit
est
"github.com/google/cadvisor/info/v1/test"
)
func
testHTTPContainerInfoGetter
(
req
*
cadvisor
A
pi
.
ContainerInfoRequest
,
cinfo
*
cadvisor
A
pi
.
ContainerInfo
,
req
*
cadvisor
a
pi
.
ContainerInfoRequest
,
cinfo
*
cadvisor
a
pi
.
ContainerInfo
,
podID
string
,
containerID
string
,
status
int
,
...
...
@@ -53,7 +53,7 @@ func testHTTPContainerInfoGetter(
expectedPath
,
r
.
URL
.
Path
)
}
var
receivedReq
cadvisor
A
pi
.
ContainerInfoRequest
var
receivedReq
cadvisor
a
pi
.
ContainerInfoRequest
err
:=
json
.
NewDecoder
(
r
.
Body
)
.
Decode
(
&
receivedReq
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
...
...
@@ -87,7 +87,7 @@ func testHTTPContainerInfoGetter(
Port
:
port
,
}
var
receivedContainerInfo
*
cadvisor
A
pi
.
ContainerInfo
var
receivedContainerInfo
*
cadvisor
a
pi
.
ContainerInfo
if
len
(
podID
)
>
0
&&
len
(
containerID
)
>
0
{
receivedContainerInfo
,
err
=
containerInfoGetter
.
GetContainerInfo
(
parts
[
0
],
podID
,
containerID
,
req
)
}
else
{
...
...
@@ -109,10 +109,10 @@ func testHTTPContainerInfoGetter(
}
func
TestHTTPContainerInfoGetterGetContainerInfoSuccessfully
(
t
*
testing
.
T
)
{
req
:=
&
cadvisor
A
pi
.
ContainerInfoRequest
{
req
:=
&
cadvisor
a
pi
.
ContainerInfoRequest
{
NumStats
:
10
,
}
cinfo
:=
cadvisor
ApiT
est
.
GenerateRandomContainerInfo
(
cinfo
:=
cadvisor
apit
est
.
GenerateRandomContainerInfo
(
"dockerIDWhichWillNotBeChecked"
,
// docker ID
2
,
// Number of cores
req
,
...
...
@@ -122,10 +122,10 @@ func TestHTTPContainerInfoGetterGetContainerInfoSuccessfully(t *testing.T) {
}
func
TestHTTPContainerInfoGetterGetRootInfoSuccessfully
(
t
*
testing
.
T
)
{
req
:=
&
cadvisor
A
pi
.
ContainerInfoRequest
{
req
:=
&
cadvisor
a
pi
.
ContainerInfoRequest
{
NumStats
:
10
,
}
cinfo
:=
cadvisor
ApiT
est
.
GenerateRandomContainerInfo
(
cinfo
:=
cadvisor
apit
est
.
GenerateRandomContainerInfo
(
"dockerIDWhichWillNotBeChecked"
,
// docker ID
2
,
// Number of cores
req
,
...
...
@@ -135,10 +135,10 @@ func TestHTTPContainerInfoGetterGetRootInfoSuccessfully(t *testing.T) {
}
func
TestHTTPContainerInfoGetterGetContainerInfoWithError
(
t
*
testing
.
T
)
{
req
:=
&
cadvisor
A
pi
.
ContainerInfoRequest
{
req
:=
&
cadvisor
a
pi
.
ContainerInfoRequest
{
NumStats
:
10
,
}
cinfo
:=
cadvisor
ApiT
est
.
GenerateRandomContainerInfo
(
cinfo
:=
cadvisor
apit
est
.
GenerateRandomContainerInfo
(
"dockerIDWhichWillNotBeChecked"
,
// docker ID
2
,
// Number of cores
req
,
...
...
@@ -148,10 +148,10 @@ func TestHTTPContainerInfoGetterGetContainerInfoWithError(t *testing.T) {
}
func
TestHTTPContainerInfoGetterGetRootInfoWithError
(
t
*
testing
.
T
)
{
req
:=
&
cadvisor
A
pi
.
ContainerInfoRequest
{
req
:=
&
cadvisor
a
pi
.
ContainerInfoRequest
{
NumStats
:
10
,
}
cinfo
:=
cadvisor
ApiT
est
.
GenerateRandomContainerInfo
(
cinfo
:=
cadvisor
apit
est
.
GenerateRandomContainerInfo
(
"dockerIDWhichWillNotBeChecked"
,
// docker ID
2
,
// Number of cores
req
,
...
...
@@ -161,7 +161,7 @@ func TestHTTPContainerInfoGetterGetRootInfoWithError(t *testing.T) {
}
func
TestHTTPGetMachineInfo
(
t
*
testing
.
T
)
{
mspec
:=
&
cadvisor
A
pi
.
MachineInfo
{
mspec
:=
&
cadvisor
a
pi
.
MachineInfo
{
NumCores
:
4
,
MemoryCapacity
:
2048
,
}
...
...
pkg/kubelet/cadvisor/cadvisor_fake.go
View file @
09a38715
...
...
@@ -18,8 +18,8 @@ package cadvisor
import
(
"github.com/google/cadvisor/events"
cadvisor
A
pi
"github.com/google/cadvisor/info/v1"
cadvisor
ApiV
2
"github.com/google/cadvisor/info/v2"
cadvisor
a
pi
"github.com/google/cadvisor/info/v1"
cadvisor
apiv
2
"github.com/google/cadvisor/info/v2"
)
// Fake cAdvisor implementation.
...
...
@@ -32,32 +32,32 @@ func (c *Fake) Start() error {
return
nil
}
func
(
c
*
Fake
)
ContainerInfo
(
name
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
*
cadvisorA
pi
.
ContainerInfo
,
error
)
{
return
new
(
cadvisor
A
pi
.
ContainerInfo
),
nil
func
(
c
*
Fake
)
ContainerInfo
(
name
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
*
cadvisora
pi
.
ContainerInfo
,
error
)
{
return
new
(
cadvisor
a
pi
.
ContainerInfo
),
nil
}
func
(
c
*
Fake
)
SubcontainerInfo
(
name
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
map
[
string
]
*
cadvisorA
pi
.
ContainerInfo
,
error
)
{
return
map
[
string
]
*
cadvisor
A
pi
.
ContainerInfo
{},
nil
func
(
c
*
Fake
)
SubcontainerInfo
(
name
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
map
[
string
]
*
cadvisora
pi
.
ContainerInfo
,
error
)
{
return
map
[
string
]
*
cadvisor
a
pi
.
ContainerInfo
{},
nil
}
func
(
c
*
Fake
)
DockerContainer
(
name
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
cadvisorA
pi
.
ContainerInfo
,
error
)
{
return
cadvisor
A
pi
.
ContainerInfo
{},
nil
func
(
c
*
Fake
)
DockerContainer
(
name
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
cadvisora
pi
.
ContainerInfo
,
error
)
{
return
cadvisor
a
pi
.
ContainerInfo
{},
nil
}
func
(
c
*
Fake
)
MachineInfo
()
(
*
cadvisor
A
pi
.
MachineInfo
,
error
)
{
return
new
(
cadvisor
A
pi
.
MachineInfo
),
nil
func
(
c
*
Fake
)
MachineInfo
()
(
*
cadvisor
a
pi
.
MachineInfo
,
error
)
{
return
new
(
cadvisor
a
pi
.
MachineInfo
),
nil
}
func
(
c
*
Fake
)
VersionInfo
()
(
*
cadvisor
A
pi
.
VersionInfo
,
error
)
{
return
new
(
cadvisor
A
pi
.
VersionInfo
),
nil
func
(
c
*
Fake
)
VersionInfo
()
(
*
cadvisor
a
pi
.
VersionInfo
,
error
)
{
return
new
(
cadvisor
a
pi
.
VersionInfo
),
nil
}
func
(
c
*
Fake
)
DockerImagesFsInfo
()
(
cadvisor
ApiV
2
.
FsInfo
,
error
)
{
return
cadvisor
ApiV
2
.
FsInfo
{},
nil
func
(
c
*
Fake
)
DockerImagesFsInfo
()
(
cadvisor
apiv
2
.
FsInfo
,
error
)
{
return
cadvisor
apiv
2
.
FsInfo
{},
nil
}
func
(
c
*
Fake
)
RootFsInfo
()
(
cadvisor
ApiV
2
.
FsInfo
,
error
)
{
return
cadvisor
ApiV
2
.
FsInfo
{},
nil
func
(
c
*
Fake
)
RootFsInfo
()
(
cadvisor
apiv
2
.
FsInfo
,
error
)
{
return
cadvisor
apiv
2
.
FsInfo
{},
nil
}
func
(
c
*
Fake
)
WatchEvents
(
request
*
events
.
Request
)
(
*
events
.
EventChannel
,
error
)
{
...
...
pkg/kubelet/cadvisor/cadvisor_linux.go
View file @
09a38715
...
...
@@ -28,8 +28,8 @@ import (
"github.com/google/cadvisor/events"
cadvisorFs
"github.com/google/cadvisor/fs"
cadvisorHttp
"github.com/google/cadvisor/http"
cadvisor
A
pi
"github.com/google/cadvisor/info/v1"
cadvisor
ApiV
2
"github.com/google/cadvisor/info/v2"
cadvisor
a
pi
"github.com/google/cadvisor/info/v1"
cadvisor
apiv
2
"github.com/google/cadvisor/info/v2"
"github.com/google/cadvisor/manager"
"github.com/google/cadvisor/utils/sysfs"
"k8s.io/kubernetes/pkg/util"
...
...
@@ -109,46 +109,46 @@ func (cc *cadvisorClient) exportHTTP(port uint) error {
return
nil
}
func
(
cc
*
cadvisorClient
)
ContainerInfo
(
name
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
*
cadvisorA
pi
.
ContainerInfo
,
error
)
{
func
(
cc
*
cadvisorClient
)
ContainerInfo
(
name
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
*
cadvisora
pi
.
ContainerInfo
,
error
)
{
return
cc
.
GetContainerInfo
(
name
,
req
)
}
func
(
cc
*
cadvisorClient
)
VersionInfo
()
(
*
cadvisor
A
pi
.
VersionInfo
,
error
)
{
func
(
cc
*
cadvisorClient
)
VersionInfo
()
(
*
cadvisor
a
pi
.
VersionInfo
,
error
)
{
return
cc
.
GetVersionInfo
()
}
func
(
cc
*
cadvisorClient
)
SubcontainerInfo
(
name
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
map
[
string
]
*
cadvisorA
pi
.
ContainerInfo
,
error
)
{
func
(
cc
*
cadvisorClient
)
SubcontainerInfo
(
name
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
map
[
string
]
*
cadvisora
pi
.
ContainerInfo
,
error
)
{
infos
,
err
:=
cc
.
SubcontainersInfo
(
name
,
req
)
if
err
!=
nil
{
return
nil
,
err
}
result
:=
make
(
map
[
string
]
*
cadvisor
A
pi
.
ContainerInfo
,
len
(
infos
))
result
:=
make
(
map
[
string
]
*
cadvisor
a
pi
.
ContainerInfo
,
len
(
infos
))
for
_
,
info
:=
range
infos
{
result
[
info
.
Name
]
=
info
}
return
result
,
nil
}
func
(
cc
*
cadvisorClient
)
MachineInfo
()
(
*
cadvisor
A
pi
.
MachineInfo
,
error
)
{
func
(
cc
*
cadvisorClient
)
MachineInfo
()
(
*
cadvisor
a
pi
.
MachineInfo
,
error
)
{
return
cc
.
GetMachineInfo
()
}
func
(
cc
*
cadvisorClient
)
DockerImagesFsInfo
()
(
cadvisor
ApiV
2
.
FsInfo
,
error
)
{
func
(
cc
*
cadvisorClient
)
DockerImagesFsInfo
()
(
cadvisor
apiv
2
.
FsInfo
,
error
)
{
return
cc
.
getFsInfo
(
cadvisorFs
.
LabelDockerImages
)
}
func
(
cc
*
cadvisorClient
)
RootFsInfo
()
(
cadvisor
ApiV
2
.
FsInfo
,
error
)
{
func
(
cc
*
cadvisorClient
)
RootFsInfo
()
(
cadvisor
apiv
2
.
FsInfo
,
error
)
{
return
cc
.
getFsInfo
(
cadvisorFs
.
LabelSystemRoot
)
}
func
(
cc
*
cadvisorClient
)
getFsInfo
(
label
string
)
(
cadvisor
ApiV
2
.
FsInfo
,
error
)
{
func
(
cc
*
cadvisorClient
)
getFsInfo
(
label
string
)
(
cadvisor
apiv
2
.
FsInfo
,
error
)
{
res
,
err
:=
cc
.
GetFsInfo
(
label
)
if
err
!=
nil
{
return
cadvisor
ApiV
2
.
FsInfo
{},
err
return
cadvisor
apiv
2
.
FsInfo
{},
err
}
if
len
(
res
)
==
0
{
return
cadvisor
ApiV
2
.
FsInfo
{},
fmt
.
Errorf
(
"failed to find information for the filesystem labeled %q"
,
label
)
return
cadvisor
apiv
2
.
FsInfo
{},
fmt
.
Errorf
(
"failed to find information for the filesystem labeled %q"
,
label
)
}
// TODO(vmarmol): Handle this better when a label has more than one image filesystem.
if
len
(
res
)
>
1
{
...
...
pkg/kubelet/cadvisor/cadvisor_mock.go
View file @
09a38715
...
...
@@ -18,8 +18,8 @@ package cadvisor
import
(
"github.com/google/cadvisor/events"
cadvisor
A
pi
"github.com/google/cadvisor/info/v1"
cadvisor
ApiV
2
"github.com/google/cadvisor/info/v2"
cadvisor
a
pi
"github.com/google/cadvisor/info/v1"
cadvisor
apiv
2
"github.com/google/cadvisor/info/v2"
"github.com/stretchr/testify/mock"
)
...
...
@@ -35,41 +35,41 @@ func (c *Mock) Start() error {
}
// ContainerInfo is a mock implementation of Interface.ContainerInfo.
func
(
c
*
Mock
)
ContainerInfo
(
name
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
*
cadvisorA
pi
.
ContainerInfo
,
error
)
{
func
(
c
*
Mock
)
ContainerInfo
(
name
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
*
cadvisora
pi
.
ContainerInfo
,
error
)
{
args
:=
c
.
Called
(
name
,
req
)
return
args
.
Get
(
0
)
.
(
*
cadvisor
A
pi
.
ContainerInfo
),
args
.
Error
(
1
)
return
args
.
Get
(
0
)
.
(
*
cadvisor
a
pi
.
ContainerInfo
),
args
.
Error
(
1
)
}
func
(
c
*
Mock
)
SubcontainerInfo
(
name
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
map
[
string
]
*
cadvisorA
pi
.
ContainerInfo
,
error
)
{
func
(
c
*
Mock
)
SubcontainerInfo
(
name
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
map
[
string
]
*
cadvisora
pi
.
ContainerInfo
,
error
)
{
args
:=
c
.
Called
(
name
,
req
)
return
args
.
Get
(
0
)
.
(
map
[
string
]
*
cadvisor
A
pi
.
ContainerInfo
),
args
.
Error
(
1
)
return
args
.
Get
(
0
)
.
(
map
[
string
]
*
cadvisor
a
pi
.
ContainerInfo
),
args
.
Error
(
1
)
}
// DockerContainer is a mock implementation of Interface.DockerContainer.
func
(
c
*
Mock
)
DockerContainer
(
name
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
cadvisorA
pi
.
ContainerInfo
,
error
)
{
func
(
c
*
Mock
)
DockerContainer
(
name
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
cadvisora
pi
.
ContainerInfo
,
error
)
{
args
:=
c
.
Called
(
name
,
req
)
return
args
.
Get
(
0
)
.
(
cadvisor
A
pi
.
ContainerInfo
),
args
.
Error
(
1
)
return
args
.
Get
(
0
)
.
(
cadvisor
a
pi
.
ContainerInfo
),
args
.
Error
(
1
)
}
// MachineInfo is a mock implementation of Interface.MachineInfo.
func
(
c
*
Mock
)
MachineInfo
()
(
*
cadvisor
A
pi
.
MachineInfo
,
error
)
{
func
(
c
*
Mock
)
MachineInfo
()
(
*
cadvisor
a
pi
.
MachineInfo
,
error
)
{
args
:=
c
.
Called
()
return
args
.
Get
(
0
)
.
(
*
cadvisor
A
pi
.
MachineInfo
),
args
.
Error
(
1
)
return
args
.
Get
(
0
)
.
(
*
cadvisor
a
pi
.
MachineInfo
),
args
.
Error
(
1
)
}
func
(
c
*
Mock
)
VersionInfo
()
(
*
cadvisor
A
pi
.
VersionInfo
,
error
)
{
func
(
c
*
Mock
)
VersionInfo
()
(
*
cadvisor
a
pi
.
VersionInfo
,
error
)
{
args
:=
c
.
Called
()
return
args
.
Get
(
0
)
.
(
*
cadvisor
A
pi
.
VersionInfo
),
args
.
Error
(
1
)
return
args
.
Get
(
0
)
.
(
*
cadvisor
a
pi
.
VersionInfo
),
args
.
Error
(
1
)
}
func
(
c
*
Mock
)
DockerImagesFsInfo
()
(
cadvisor
ApiV
2
.
FsInfo
,
error
)
{
func
(
c
*
Mock
)
DockerImagesFsInfo
()
(
cadvisor
apiv
2
.
FsInfo
,
error
)
{
args
:=
c
.
Called
()
return
args
.
Get
(
0
)
.
(
cadvisor
ApiV
2
.
FsInfo
),
args
.
Error
(
1
)
return
args
.
Get
(
0
)
.
(
cadvisor
apiv
2
.
FsInfo
),
args
.
Error
(
1
)
}
func
(
c
*
Mock
)
RootFsInfo
()
(
cadvisor
ApiV
2
.
FsInfo
,
error
)
{
func
(
c
*
Mock
)
RootFsInfo
()
(
cadvisor
apiv
2
.
FsInfo
,
error
)
{
args
:=
c
.
Called
()
return
args
.
Get
(
0
)
.
(
cadvisor
ApiV
2
.
FsInfo
),
args
.
Error
(
1
)
return
args
.
Get
(
0
)
.
(
cadvisor
apiv
2
.
FsInfo
),
args
.
Error
(
1
)
}
func
(
c
*
Mock
)
WatchEvents
(
request
*
events
.
Request
)
(
*
events
.
EventChannel
,
error
)
{
...
...
pkg/kubelet/cadvisor/cadvisor_unsupported.go
View file @
09a38715
...
...
@@ -22,8 +22,8 @@ import (
"errors"
"github.com/google/cadvisor/events"
cadvisor
A
pi
"github.com/google/cadvisor/info/v1"
cadvisor
ApiV
2
"github.com/google/cadvisor/info/v2"
cadvisor
a
pi
"github.com/google/cadvisor/info/v1"
cadvisor
apiv
2
"github.com/google/cadvisor/info/v2"
)
type
cadvisorUnsupported
struct
{
...
...
@@ -41,32 +41,32 @@ func (cu *cadvisorUnsupported) Start() error {
return
unsupportedErr
}
func
(
cu
*
cadvisorUnsupported
)
DockerContainer
(
name
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
cadvisorA
pi
.
ContainerInfo
,
error
)
{
return
cadvisor
A
pi
.
ContainerInfo
{},
unsupportedErr
func
(
cu
*
cadvisorUnsupported
)
DockerContainer
(
name
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
cadvisora
pi
.
ContainerInfo
,
error
)
{
return
cadvisor
a
pi
.
ContainerInfo
{},
unsupportedErr
}
func
(
cu
*
cadvisorUnsupported
)
ContainerInfo
(
name
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
*
cadvisorA
pi
.
ContainerInfo
,
error
)
{
func
(
cu
*
cadvisorUnsupported
)
ContainerInfo
(
name
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
*
cadvisora
pi
.
ContainerInfo
,
error
)
{
return
nil
,
unsupportedErr
}
func
(
cu
*
cadvisorUnsupported
)
SubcontainerInfo
(
name
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
map
[
string
]
*
cadvisorA
pi
.
ContainerInfo
,
error
)
{
func
(
cu
*
cadvisorUnsupported
)
SubcontainerInfo
(
name
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
map
[
string
]
*
cadvisora
pi
.
ContainerInfo
,
error
)
{
return
nil
,
unsupportedErr
}
func
(
cu
*
cadvisorUnsupported
)
MachineInfo
()
(
*
cadvisor
A
pi
.
MachineInfo
,
error
)
{
func
(
cu
*
cadvisorUnsupported
)
MachineInfo
()
(
*
cadvisor
a
pi
.
MachineInfo
,
error
)
{
return
nil
,
unsupportedErr
}
func
(
cu
*
cadvisorUnsupported
)
VersionInfo
()
(
*
cadvisor
A
pi
.
VersionInfo
,
error
)
{
func
(
cu
*
cadvisorUnsupported
)
VersionInfo
()
(
*
cadvisor
a
pi
.
VersionInfo
,
error
)
{
return
nil
,
unsupportedErr
}
func
(
cu
*
cadvisorUnsupported
)
DockerImagesFsInfo
()
(
cadvisor
ApiV
2
.
FsInfo
,
error
)
{
return
cadvisor
ApiV
2
.
FsInfo
{},
unsupportedErr
func
(
cu
*
cadvisorUnsupported
)
DockerImagesFsInfo
()
(
cadvisor
apiv
2
.
FsInfo
,
error
)
{
return
cadvisor
apiv
2
.
FsInfo
{},
unsupportedErr
}
func
(
cu
*
cadvisorUnsupported
)
RootFsInfo
()
(
cadvisor
ApiV
2
.
FsInfo
,
error
)
{
return
cadvisor
ApiV
2
.
FsInfo
{},
unsupportedErr
func
(
cu
*
cadvisorUnsupported
)
RootFsInfo
()
(
cadvisor
apiv
2
.
FsInfo
,
error
)
{
return
cadvisor
apiv
2
.
FsInfo
{},
unsupportedErr
}
func
(
cu
*
cadvisorUnsupported
)
WatchEvents
(
request
*
events
.
Request
)
(
*
events
.
EventChannel
,
error
)
{
...
...
pkg/kubelet/cadvisor/types.go
View file @
09a38715
...
...
@@ -18,25 +18,25 @@ package cadvisor
import
(
"github.com/google/cadvisor/events"
cadvisor
A
pi
"github.com/google/cadvisor/info/v1"
cadvisor
ApiV
2
"github.com/google/cadvisor/info/v2"
cadvisor
a
pi
"github.com/google/cadvisor/info/v1"
cadvisor
apiv
2
"github.com/google/cadvisor/info/v2"
)
// Interface is an abstract interface for testability. It abstracts the interface to cAdvisor.
type
Interface
interface
{
Start
()
error
DockerContainer
(
name
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
cadvisorA
pi
.
ContainerInfo
,
error
)
ContainerInfo
(
name
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
*
cadvisorA
pi
.
ContainerInfo
,
error
)
SubcontainerInfo
(
name
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
map
[
string
]
*
cadvisorA
pi
.
ContainerInfo
,
error
)
MachineInfo
()
(
*
cadvisor
A
pi
.
MachineInfo
,
error
)
DockerContainer
(
name
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
cadvisora
pi
.
ContainerInfo
,
error
)
ContainerInfo
(
name
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
*
cadvisora
pi
.
ContainerInfo
,
error
)
SubcontainerInfo
(
name
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
map
[
string
]
*
cadvisora
pi
.
ContainerInfo
,
error
)
MachineInfo
()
(
*
cadvisor
a
pi
.
MachineInfo
,
error
)
VersionInfo
()
(
*
cadvisor
A
pi
.
VersionInfo
,
error
)
VersionInfo
()
(
*
cadvisor
a
pi
.
VersionInfo
,
error
)
// Returns usage information about the filesystem holding Docker images.
DockerImagesFsInfo
()
(
cadvisor
ApiV
2
.
FsInfo
,
error
)
DockerImagesFsInfo
()
(
cadvisor
apiv
2
.
FsInfo
,
error
)
// Returns usage information about the root filesystem.
RootFsInfo
()
(
cadvisor
ApiV
2
.
FsInfo
,
error
)
RootFsInfo
()
(
cadvisor
apiv
2
.
FsInfo
,
error
)
// Get events streamed through passedChannel that fit the request.
WatchEvents
(
request
*
events
.
Request
)
(
*
events
.
EventChannel
,
error
)
...
...
pkg/kubelet/dockertools/docker_test.go
View file @
09a38715
...
...
@@ -28,7 +28,7 @@ import (
"github.com/docker/docker/pkg/jsonmessage"
docker
"github.com/fsouza/go-dockerclient"
cadvisor
A
pi
"github.com/google/cadvisor/info/v1"
cadvisor
a
pi
"github.com/google/cadvisor/info/v1"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/client/record"
"k8s.io/kubernetes/pkg/credentialprovider"
...
...
@@ -671,7 +671,7 @@ func TestFindContainersByPod(t *testing.T) {
fakeClient
:=
&
FakeDockerClient
{}
np
,
_
:=
network
.
InitNetworkPlugin
([]
network
.
NetworkPlugin
{},
""
,
network
.
NewFakeHost
(
nil
))
// image back-off is set to nil, this test shouldnt pull images
containerManager
:=
NewFakeDockerManager
(
fakeClient
,
&
record
.
FakeRecorder
{},
nil
,
nil
,
&
cadvisor
A
pi
.
MachineInfo
{},
PodInfraContainerImage
,
0
,
0
,
""
,
kubecontainer
.
FakeOS
{},
np
,
nil
,
nil
,
nil
)
containerManager
:=
NewFakeDockerManager
(
fakeClient
,
&
record
.
FakeRecorder
{},
nil
,
nil
,
&
cadvisor
a
pi
.
MachineInfo
{},
PodInfraContainerImage
,
0
,
0
,
""
,
kubecontainer
.
FakeOS
{},
np
,
nil
,
nil
,
nil
)
for
i
,
test
:=
range
tests
{
fakeClient
.
ContainerList
=
test
.
containerList
fakeClient
.
ExitedContainerList
=
test
.
exitedContainerList
...
...
pkg/kubelet/dockertools/fake_manager.go
View file @
09a38715
...
...
@@ -17,7 +17,7 @@ limitations under the License.
package
dockertools
import
(
cadvisor
A
pi
"github.com/google/cadvisor/info/v1"
cadvisor
a
pi
"github.com/google/cadvisor/info/v1"
"k8s.io/kubernetes/pkg/client/record"
kubecontainer
"k8s.io/kubernetes/pkg/kubelet/container"
"k8s.io/kubernetes/pkg/kubelet/network"
...
...
@@ -33,7 +33,7 @@ func NewFakeDockerManager(
recorder
record
.
EventRecorder
,
prober
prober
.
Prober
,
containerRefManager
*
kubecontainer
.
RefManager
,
machineInfo
*
cadvisor
A
pi
.
MachineInfo
,
machineInfo
*
cadvisor
a
pi
.
MachineInfo
,
podInfraContainerImage
string
,
qps
float32
,
burst
int
,
...
...
pkg/kubelet/dockertools/manager.go
View file @
09a38715
...
...
@@ -34,7 +34,7 @@ import (
docker
"github.com/fsouza/go-dockerclient"
"github.com/golang/glog"
"github.com/golang/groupcache/lru"
cadvisor
A
pi
"github.com/google/cadvisor/info/v1"
cadvisor
a
pi
"github.com/google/cadvisor/info/v1"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/latest"
"k8s.io/kubernetes/pkg/api/unversioned"
...
...
@@ -89,7 +89,7 @@ type DockerManager struct {
recorder
record
.
EventRecorder
containerRefManager
*
kubecontainer
.
RefManager
os
kubecontainer
.
OSInterface
machineInfo
*
cadvisor
A
pi
.
MachineInfo
machineInfo
*
cadvisor
a
pi
.
MachineInfo
// The image name of the pod infra container.
podInfraContainerImage
string
...
...
@@ -149,7 +149,7 @@ func NewDockerManager(
recorder
record
.
EventRecorder
,
prober
prober
.
Prober
,
containerRefManager
*
kubecontainer
.
RefManager
,
machineInfo
*
cadvisor
A
pi
.
MachineInfo
,
machineInfo
*
cadvisor
a
pi
.
MachineInfo
,
podInfraContainerImage
string
,
qps
float32
,
burst
int
,
...
...
pkg/kubelet/dockertools/manager_test.go
View file @
09a38715
...
...
@@ -30,7 +30,7 @@ import (
"time"
docker
"github.com/fsouza/go-dockerclient"
cadvisor
A
pi
"github.com/google/cadvisor/info/v1"
cadvisor
a
pi
"github.com/google/cadvisor/info/v1"
"github.com/stretchr/testify/assert"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi"
...
...
@@ -85,7 +85,7 @@ func newTestDockerManagerWithHTTPClient(fakeHTTPClient *fakeHTTP) (*DockerManage
fakeRecorder
,
prober
.
FakeProber
{},
containerRefManager
,
&
cadvisor
A
pi
.
MachineInfo
{},
&
cadvisor
a
pi
.
MachineInfo
{},
PodInfraContainerImage
,
0
,
0
,
""
,
kubecontainer
.
FakeOS
{},
...
...
pkg/kubelet/kubelet.go
View file @
09a38715
...
...
@@ -34,7 +34,7 @@ import (
"time"
"github.com/golang/glog"
cadvisor
A
pi
"github.com/google/cadvisor/info/v1"
cadvisor
a
pi
"github.com/google/cadvisor/info/v1"
"k8s.io/kubernetes/pkg/api"
apierrors
"k8s.io/kubernetes/pkg/api/errors"
"k8s.io/kubernetes/pkg/api/resource"
...
...
@@ -530,7 +530,7 @@ type Kubelet struct {
diskSpaceManager
diskSpaceManager
// Cached MachineInfo returned by cadvisor.
machineInfo
*
cadvisor
A
pi
.
MachineInfo
machineInfo
*
cadvisor
a
pi
.
MachineInfo
// Syncs pods statuses with apiserver; also used as a cache of statuses.
statusManager
status
.
Manager
...
...
@@ -2769,7 +2769,7 @@ func (kl *Kubelet) ResyncInterval() time.Duration {
}
// GetContainerInfo returns stats (from Cadvisor) for a container.
func
(
kl
*
Kubelet
)
GetContainerInfo
(
podFullName
string
,
podUID
types
.
UID
,
containerName
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
*
cadvisorA
pi
.
ContainerInfo
,
error
)
{
func
(
kl
*
Kubelet
)
GetContainerInfo
(
podFullName
string
,
podUID
types
.
UID
,
containerName
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
*
cadvisora
pi
.
ContainerInfo
,
error
)
{
podUID
=
kl
.
podManager
.
TranslatePodUID
(
podUID
)
...
...
@@ -2791,7 +2791,7 @@ func (kl *Kubelet) GetContainerInfo(podFullName string, podUID types.UID, contai
}
// Returns stats (from Cadvisor) for a non-Kubernetes container.
func
(
kl
*
Kubelet
)
GetRawContainerInfo
(
containerName
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
,
subcontainers
bool
)
(
map
[
string
]
*
cadvisorA
pi
.
ContainerInfo
,
error
)
{
func
(
kl
*
Kubelet
)
GetRawContainerInfo
(
containerName
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
,
subcontainers
bool
)
(
map
[
string
]
*
cadvisora
pi
.
ContainerInfo
,
error
)
{
if
subcontainers
{
return
kl
.
cadvisor
.
SubcontainerInfo
(
containerName
,
req
)
}
else
{
...
...
@@ -2799,14 +2799,14 @@ func (kl *Kubelet) GetRawContainerInfo(containerName string, req *cadvisorApi.Co
if
err
!=
nil
{
return
nil
,
err
}
return
map
[
string
]
*
cadvisor
A
pi
.
ContainerInfo
{
return
map
[
string
]
*
cadvisor
a
pi
.
ContainerInfo
{
containerInfo
.
Name
:
containerInfo
,
},
nil
}
}
// GetCachedMachineInfo assumes that the machine info can't change without a reboot
func
(
kl
*
Kubelet
)
GetCachedMachineInfo
()
(
*
cadvisor
A
pi
.
MachineInfo
,
error
)
{
func
(
kl
*
Kubelet
)
GetCachedMachineInfo
()
(
*
cadvisor
a
pi
.
MachineInfo
,
error
)
{
if
kl
.
machineInfo
==
nil
{
info
,
err
:=
kl
.
cadvisor
.
MachineInfo
()
if
err
!=
nil
{
...
...
pkg/kubelet/kubelet_test.go
View file @
09a38715
This diff is collapsed.
Click to expand it.
pkg/kubelet/network/cni/cni_test.go
View file @
09a38715
...
...
@@ -29,7 +29,7 @@ import (
"text/template"
docker
"github.com/fsouza/go-dockerclient"
cadvisor
A
pi
"github.com/google/cadvisor/info/v1"
cadvisor
a
pi
"github.com/google/cadvisor/info/v1"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/client/record"
...
...
@@ -154,7 +154,7 @@ func newTestDockerManager() (*dockertools.DockerManager, *dockertools.FakeDocker
fakeRecorder
,
prober
.
FakeProber
{},
containerRefManager
,
&
cadvisor
A
pi
.
MachineInfo
{},
&
cadvisor
a
pi
.
MachineInfo
{},
dockertools
.
PodInfraContainerImage
,
0
,
0
,
""
,
kubecontainer
.
FakeOS
{},
...
...
pkg/kubelet/oom_watcher.go
View file @
09a38715
...
...
@@ -19,7 +19,7 @@ package kubelet
import
(
"github.com/golang/glog"
"github.com/google/cadvisor/events"
cadvisor
A
pi
"github.com/google/cadvisor/info/v1"
cadvisor
a
pi
"github.com/google/cadvisor/info/v1"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/client/record"
...
...
@@ -48,8 +48,8 @@ const systemOOMEvent = "SystemOOM"
// Watches cadvisor for system oom's and records an event for every system oom encountered.
func
(
ow
*
realOOMWatcher
)
Start
(
ref
*
api
.
ObjectReference
)
error
{
request
:=
events
.
Request
{
EventType
:
map
[
cadvisor
A
pi
.
EventType
]
bool
{
cadvisor
A
pi
.
EventOom
:
true
,
EventType
:
map
[
cadvisor
a
pi
.
EventType
]
bool
{
cadvisor
a
pi
.
EventOom
:
true
,
},
ContainerName
:
"/"
,
IncludeSubcontainers
:
false
,
...
...
pkg/kubelet/pod_workers_test.go
View file @
09a38715
...
...
@@ -24,7 +24,7 @@ import (
"time"
docker
"github.com/fsouza/go-dockerclient"
cadvisor
A
pi
"github.com/google/cadvisor/info/v1"
cadvisor
a
pi
"github.com/google/cadvisor/info/v1"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/client/record"
kubecontainer
"k8s.io/kubernetes/pkg/kubelet/container"
...
...
@@ -46,7 +46,7 @@ func newPod(uid, name string) *api.Pod {
func
createFakeRuntimeCache
(
fakeRecorder
*
record
.
FakeRecorder
)
kubecontainer
.
RuntimeCache
{
fakeDocker
:=
&
dockertools
.
FakeDockerClient
{}
np
,
_
:=
network
.
InitNetworkPlugin
([]
network
.
NetworkPlugin
{},
""
,
network
.
NewFakeHost
(
nil
))
dockerManager
:=
dockertools
.
NewFakeDockerManager
(
fakeDocker
,
fakeRecorder
,
nil
,
nil
,
&
cadvisor
A
pi
.
MachineInfo
{},
dockertools
.
PodInfraContainerImage
,
0
,
0
,
""
,
kubecontainer
.
FakeOS
{},
np
,
nil
,
nil
,
nil
)
dockerManager
:=
dockertools
.
NewFakeDockerManager
(
fakeDocker
,
fakeRecorder
,
nil
,
nil
,
&
cadvisor
a
pi
.
MachineInfo
{},
dockertools
.
PodInfraContainerImage
,
0
,
0
,
""
,
kubecontainer
.
FakeOS
{},
np
,
nil
,
nil
,
nil
)
return
kubecontainer
.
NewFakeRuntimeCache
(
dockerManager
)
}
...
...
@@ -194,7 +194,7 @@ func TestFakePodWorkers(t *testing.T) {
fakeDocker
:=
&
dockertools
.
FakeDockerClient
{}
fakeRecorder
:=
&
record
.
FakeRecorder
{}
np
,
_
:=
network
.
InitNetworkPlugin
([]
network
.
NetworkPlugin
{},
""
,
network
.
NewFakeHost
(
nil
))
dockerManager
:=
dockertools
.
NewFakeDockerManager
(
fakeDocker
,
fakeRecorder
,
nil
,
nil
,
&
cadvisor
A
pi
.
MachineInfo
{},
dockertools
.
PodInfraContainerImage
,
0
,
0
,
""
,
kubecontainer
.
FakeOS
{},
np
,
nil
,
nil
,
nil
)
dockerManager
:=
dockertools
.
NewFakeDockerManager
(
fakeDocker
,
fakeRecorder
,
nil
,
nil
,
&
cadvisor
a
pi
.
MachineInfo
{},
dockertools
.
PodInfraContainerImage
,
0
,
0
,
""
,
kubecontainer
.
FakeOS
{},
np
,
nil
,
nil
,
nil
)
fakeRuntimeCache
:=
kubecontainer
.
NewFakeRuntimeCache
(
dockerManager
)
kubeletForRealWorkers
:=
&
simpleFakeKubelet
{}
...
...
pkg/kubelet/runonce_test.go
View file @
09a38715
...
...
@@ -20,7 +20,7 @@ import (
"testing"
"time"
cadvisor
A
pi
"github.com/google/cadvisor/info/v1"
cadvisor
a
pi
"github.com/google/cadvisor/info/v1"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/client/record"
"k8s.io/kubernetes/pkg/kubelet/cadvisor"
...
...
@@ -32,7 +32,7 @@ import (
func
TestRunOnce
(
t
*
testing
.
T
)
{
cadvisor
:=
&
cadvisor
.
Mock
{}
cadvisor
.
On
(
"MachineInfo"
)
.
Return
(
&
cadvisor
A
pi
.
MachineInfo
{},
nil
)
cadvisor
.
On
(
"MachineInfo"
)
.
Return
(
&
cadvisor
a
pi
.
MachineInfo
{},
nil
)
podManager
:=
kubepod
.
NewBasicPodManager
(
kubepod
.
NewFakeMirrorClient
())
diskSpaceManager
,
_
:=
newDiskSpaceManager
(
cadvisor
,
DiskSpacePolicy
{})
fakeRuntime
:=
&
kubecontainer
.
FakeRuntime
{}
...
...
pkg/kubelet/server.go
View file @
09a38715
...
...
@@ -33,7 +33,7 @@ import (
restful
"github.com/emicklei/go-restful"
"github.com/golang/glog"
cadvisor
A
pi
"github.com/google/cadvisor/info/v1"
cadvisor
a
pi
"github.com/google/cadvisor/info/v1"
"github.com/prometheus/client_golang/prometheus"
"k8s.io/kubernetes/pkg/api"
...
...
@@ -137,10 +137,10 @@ type AuthInterface interface {
// HostInterface contains all the kubelet methods required by the server.
// For testablitiy.
type
HostInterface
interface
{
GetContainerInfo
(
podFullName
string
,
uid
types
.
UID
,
containerName
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
*
cadvisorA
pi
.
ContainerInfo
,
error
)
GetContainerInfo
(
podFullName
string
,
uid
types
.
UID
,
containerName
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
*
cadvisora
pi
.
ContainerInfo
,
error
)
GetContainerRuntimeVersion
()
(
kubecontainer
.
Version
,
error
)
GetRawContainerInfo
(
containerName
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
,
subcontainers
bool
)
(
map
[
string
]
*
cadvisorA
pi
.
ContainerInfo
,
error
)
GetCachedMachineInfo
()
(
*
cadvisor
A
pi
.
MachineInfo
,
error
)
GetRawContainerInfo
(
containerName
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
,
subcontainers
bool
)
(
map
[
string
]
*
cadvisora
pi
.
ContainerInfo
,
error
)
GetCachedMachineInfo
()
(
*
cadvisor
a
pi
.
MachineInfo
,
error
)
GetPods
()
[]
*
api
.
Pod
GetRunningPods
()
([]
*
api
.
Pod
,
error
)
GetPodByName
(
namespace
,
name
string
)
(
*
api
.
Pod
,
bool
)
...
...
@@ -232,7 +232,7 @@ func (s *Server) InstallDefaultHandlers() {
ws
.
Route
(
ws
.
GET
(
""
)
.
To
(
s
.
getSpec
)
.
Operation
(
"getSpec"
)
.
Writes
(
cadvisor
A
pi
.
MachineInfo
{}))
Writes
(
cadvisor
a
pi
.
MachineInfo
{}))
s
.
restfulCont
.
Add
(
ws
)
}
...
...
@@ -1101,7 +1101,7 @@ func (s *Server) serveStats(w http.ResponseWriter, req *http.Request) {
s
.
error
(
w
,
err
)
return
}
cadvisorRequest
:=
cadvisor
A
pi
.
ContainerInfoRequest
{
cadvisorRequest
:=
cadvisor
a
pi
.
ContainerInfoRequest
{
NumStats
:
query
.
NumStats
,
Start
:
query
.
Start
,
End
:
query
.
End
,
...
...
@@ -1110,7 +1110,7 @@ func (s *Server) serveStats(w http.ResponseWriter, req *http.Request) {
switch
len
(
components
)
{
case
1
:
// Root container stats.
var
statsMap
map
[
string
]
*
cadvisor
A
pi
.
ContainerInfo
var
statsMap
map
[
string
]
*
cadvisor
a
pi
.
ContainerInfo
statsMap
,
err
=
s
.
host
.
GetRawContainerInfo
(
"/"
,
&
cadvisorRequest
,
false
)
stats
=
statsMap
[
"/"
]
case
2
:
...
...
pkg/kubelet/server_test.go
View file @
09a38715
...
...
@@ -33,7 +33,7 @@ import (
"testing"
"time"
cadvisor
A
pi
"github.com/google/cadvisor/info/v1"
cadvisor
a
pi
"github.com/google/cadvisor/info/v1"
"k8s.io/kubernetes/pkg/api"
apierrs
"k8s.io/kubernetes/pkg/api/errors"
"k8s.io/kubernetes/pkg/auth/authorizer"
...
...
@@ -49,9 +49,9 @@ import (
type
fakeKubelet
struct
{
podByNameFunc
func
(
namespace
,
name
string
)
(
*
api
.
Pod
,
bool
)
containerInfoFunc
func
(
podFullName
string
,
uid
types
.
UID
,
containerName
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
*
cadvisorA
pi
.
ContainerInfo
,
error
)
rawInfoFunc
func
(
query
*
cadvisor
Api
.
ContainerInfoRequest
)
(
map
[
string
]
*
cadvisorA
pi
.
ContainerInfo
,
error
)
machineInfoFunc
func
()
(
*
cadvisor
A
pi
.
MachineInfo
,
error
)
containerInfoFunc
func
(
podFullName
string
,
uid
types
.
UID
,
containerName
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
*
cadvisora
pi
.
ContainerInfo
,
error
)
rawInfoFunc
func
(
query
*
cadvisor
api
.
ContainerInfoRequest
)
(
map
[
string
]
*
cadvisora
pi
.
ContainerInfo
,
error
)
machineInfoFunc
func
()
(
*
cadvisor
a
pi
.
MachineInfo
,
error
)
podsFunc
func
()
[]
*
api
.
Pod
runningPodsFunc
func
()
([]
*
api
.
Pod
,
error
)
logFunc
func
(
w
http
.
ResponseWriter
,
req
*
http
.
Request
)
...
...
@@ -79,11 +79,11 @@ func (fk *fakeKubelet) GetPodByName(namespace, name string) (*api.Pod, bool) {
return
fk
.
podByNameFunc
(
namespace
,
name
)
}
func
(
fk
*
fakeKubelet
)
GetContainerInfo
(
podFullName
string
,
uid
types
.
UID
,
containerName
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
*
cadvisorA
pi
.
ContainerInfo
,
error
)
{
func
(
fk
*
fakeKubelet
)
GetContainerInfo
(
podFullName
string
,
uid
types
.
UID
,
containerName
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
*
cadvisora
pi
.
ContainerInfo
,
error
)
{
return
fk
.
containerInfoFunc
(
podFullName
,
uid
,
containerName
,
req
)
}
func
(
fk
*
fakeKubelet
)
GetRawContainerInfo
(
containerName
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
,
subcontainers
bool
)
(
map
[
string
]
*
cadvisorA
pi
.
ContainerInfo
,
error
)
{
func
(
fk
*
fakeKubelet
)
GetRawContainerInfo
(
containerName
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
,
subcontainers
bool
)
(
map
[
string
]
*
cadvisora
pi
.
ContainerInfo
,
error
)
{
return
fk
.
rawInfoFunc
(
req
)
}
...
...
@@ -91,7 +91,7 @@ func (fk *fakeKubelet) GetContainerRuntimeVersion() (kubecontainer.Version, erro
return
fk
.
containerVersionFunc
()
}
func
(
fk
*
fakeKubelet
)
GetCachedMachineInfo
()
(
*
cadvisor
A
pi
.
MachineInfo
,
error
)
{
func
(
fk
*
fakeKubelet
)
GetCachedMachineInfo
()
(
*
cadvisor
a
pi
.
MachineInfo
,
error
)
{
return
fk
.
machineInfoFunc
()
}
...
...
@@ -218,11 +218,11 @@ func getPodName(name, namespace string) string {
func
TestContainerInfo
(
t
*
testing
.
T
)
{
fw
:=
newServerTest
()
expectedInfo
:=
&
cadvisor
A
pi
.
ContainerInfo
{}
expectedInfo
:=
&
cadvisor
a
pi
.
ContainerInfo
{}
podID
:=
"somepod"
expectedPodID
:=
getPodName
(
podID
,
""
)
expectedContainerName
:=
"goodcontainer"
fw
.
fakeKubelet
.
containerInfoFunc
=
func
(
podID
string
,
uid
types
.
UID
,
containerName
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
*
cadvisorA
pi
.
ContainerInfo
,
error
)
{
fw
.
fakeKubelet
.
containerInfoFunc
=
func
(
podID
string
,
uid
types
.
UID
,
containerName
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
*
cadvisora
pi
.
ContainerInfo
,
error
)
{
if
podID
!=
expectedPodID
||
containerName
!=
expectedContainerName
{
return
nil
,
fmt
.
Errorf
(
"bad podID or containerName: podID=%v; containerName=%v"
,
podID
,
containerName
)
}
...
...
@@ -234,7 +234,7 @@ func TestContainerInfo(t *testing.T) {
t
.
Fatalf
(
"Got error GETing: %v"
,
err
)
}
defer
resp
.
Body
.
Close
()
var
receivedInfo
cadvisor
A
pi
.
ContainerInfo
var
receivedInfo
cadvisor
a
pi
.
ContainerInfo
err
=
json
.
NewDecoder
(
resp
.
Body
)
.
Decode
(
&
receivedInfo
)
if
err
!=
nil
{
t
.
Fatalf
(
"received invalid json data: %v"
,
err
)
...
...
@@ -246,13 +246,13 @@ func TestContainerInfo(t *testing.T) {
func
TestContainerInfoWithUidNamespace
(
t
*
testing
.
T
)
{
fw
:=
newServerTest
()
expectedInfo
:=
&
cadvisor
A
pi
.
ContainerInfo
{}
expectedInfo
:=
&
cadvisor
a
pi
.
ContainerInfo
{}
podID
:=
"somepod"
expectedNamespace
:=
"custom"
expectedPodID
:=
getPodName
(
podID
,
expectedNamespace
)
expectedContainerName
:=
"goodcontainer"
expectedUid
:=
"9b01b80f-8fb4-11e4-95ab-4200af06647"
fw
.
fakeKubelet
.
containerInfoFunc
=
func
(
podID
string
,
uid
types
.
UID
,
containerName
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
*
cadvisorA
pi
.
ContainerInfo
,
error
)
{
fw
.
fakeKubelet
.
containerInfoFunc
=
func
(
podID
string
,
uid
types
.
UID
,
containerName
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
*
cadvisora
pi
.
ContainerInfo
,
error
)
{
if
podID
!=
expectedPodID
||
string
(
uid
)
!=
expectedUid
||
containerName
!=
expectedContainerName
{
return
nil
,
fmt
.
Errorf
(
"bad podID or uid or containerName: podID=%v; uid=%v; containerName=%v"
,
podID
,
uid
,
containerName
)
}
...
...
@@ -264,7 +264,7 @@ func TestContainerInfoWithUidNamespace(t *testing.T) {
t
.
Fatalf
(
"Got error GETing: %v"
,
err
)
}
defer
resp
.
Body
.
Close
()
var
receivedInfo
cadvisor
A
pi
.
ContainerInfo
var
receivedInfo
cadvisor
a
pi
.
ContainerInfo
err
=
json
.
NewDecoder
(
resp
.
Body
)
.
Decode
(
&
receivedInfo
)
if
err
!=
nil
{
t
.
Fatalf
(
"received invalid json data: %v"
,
err
)
...
...
@@ -280,7 +280,7 @@ func TestContainerNotFound(t *testing.T) {
expectedNamespace
:=
"custom"
expectedContainerName
:=
"slowstartcontainer"
expectedUid
:=
"9b01b80f-8fb4-11e4-95ab-4200af06647"
fw
.
fakeKubelet
.
containerInfoFunc
=
func
(
podID
string
,
uid
types
.
UID
,
containerName
string
,
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
*
cadvisorA
pi
.
ContainerInfo
,
error
)
{
fw
.
fakeKubelet
.
containerInfoFunc
=
func
(
podID
string
,
uid
types
.
UID
,
containerName
string
,
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
*
cadvisora
pi
.
ContainerInfo
,
error
)
{
return
nil
,
ErrContainerNotFound
}
resp
,
err
:=
http
.
Get
(
fw
.
testHTTPServer
.
URL
+
fmt
.
Sprintf
(
"/stats/%v/%v/%v/%v"
,
expectedNamespace
,
podID
,
expectedUid
,
expectedContainerName
))
...
...
@@ -295,13 +295,13 @@ func TestContainerNotFound(t *testing.T) {
func
TestRootInfo
(
t
*
testing
.
T
)
{
fw
:=
newServerTest
()
expectedInfo
:=
&
cadvisor
A
pi
.
ContainerInfo
{
ContainerReference
:
cadvisor
A
pi
.
ContainerReference
{
expectedInfo
:=
&
cadvisor
a
pi
.
ContainerInfo
{
ContainerReference
:
cadvisor
a
pi
.
ContainerReference
{
Name
:
"/"
,
},
}
fw
.
fakeKubelet
.
rawInfoFunc
=
func
(
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
map
[
string
]
*
cadvisorA
pi
.
ContainerInfo
,
error
)
{
return
map
[
string
]
*
cadvisor
A
pi
.
ContainerInfo
{
fw
.
fakeKubelet
.
rawInfoFunc
=
func
(
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
map
[
string
]
*
cadvisora
pi
.
ContainerInfo
,
error
)
{
return
map
[
string
]
*
cadvisor
a
pi
.
ContainerInfo
{
expectedInfo
.
Name
:
expectedInfo
,
},
nil
}
...
...
@@ -311,7 +311,7 @@ func TestRootInfo(t *testing.T) {
t
.
Fatalf
(
"Got error GETing: %v"
,
err
)
}
defer
resp
.
Body
.
Close
()
var
receivedInfo
cadvisor
A
pi
.
ContainerInfo
var
receivedInfo
cadvisor
a
pi
.
ContainerInfo
err
=
json
.
NewDecoder
(
resp
.
Body
)
.
Decode
(
&
receivedInfo
)
if
err
!=
nil
{
t
.
Fatalf
(
"received invalid json data: %v"
,
err
)
...
...
@@ -325,19 +325,19 @@ func TestSubcontainerContainerInfo(t *testing.T) {
fw
:=
newServerTest
()
const
kubeletContainer
=
"/kubelet"
const
kubeletSubContainer
=
"/kubelet/sub"
expectedInfo
:=
map
[
string
]
*
cadvisor
A
pi
.
ContainerInfo
{
expectedInfo
:=
map
[
string
]
*
cadvisor
a
pi
.
ContainerInfo
{
kubeletContainer
:
{
ContainerReference
:
cadvisor
A
pi
.
ContainerReference
{
ContainerReference
:
cadvisor
a
pi
.
ContainerReference
{
Name
:
kubeletContainer
,
},
},
kubeletSubContainer
:
{
ContainerReference
:
cadvisor
A
pi
.
ContainerReference
{
ContainerReference
:
cadvisor
a
pi
.
ContainerReference
{
Name
:
kubeletSubContainer
,
},
},
}
fw
.
fakeKubelet
.
rawInfoFunc
=
func
(
req
*
cadvisor
Api
.
ContainerInfoRequest
)
(
map
[
string
]
*
cadvisorA
pi
.
ContainerInfo
,
error
)
{
fw
.
fakeKubelet
.
rawInfoFunc
=
func
(
req
*
cadvisor
api
.
ContainerInfoRequest
)
(
map
[
string
]
*
cadvisora
pi
.
ContainerInfo
,
error
)
{
return
expectedInfo
,
nil
}
...
...
@@ -347,7 +347,7 @@ func TestSubcontainerContainerInfo(t *testing.T) {
t
.
Fatalf
(
"Got error GETing: %v"
,
err
)
}
defer
resp
.
Body
.
Close
()
var
receivedInfo
map
[
string
]
*
cadvisor
A
pi
.
ContainerInfo
var
receivedInfo
map
[
string
]
*
cadvisor
a
pi
.
ContainerInfo
err
=
json
.
NewDecoder
(
resp
.
Body
)
.
Decode
(
&
receivedInfo
)
if
err
!=
nil
{
t
.
Fatalf
(
"Received invalid json data: %v"
,
err
)
...
...
@@ -368,11 +368,11 @@ func TestSubcontainerContainerInfo(t *testing.T) {
func
TestMachineInfo
(
t
*
testing
.
T
)
{
fw
:=
newServerTest
()
expectedInfo
:=
&
cadvisor
A
pi
.
MachineInfo
{
expectedInfo
:=
&
cadvisor
a
pi
.
MachineInfo
{
NumCores
:
4
,
MemoryCapacity
:
1024
,
}
fw
.
fakeKubelet
.
machineInfoFunc
=
func
()
(
*
cadvisor
A
pi
.
MachineInfo
,
error
)
{
fw
.
fakeKubelet
.
machineInfoFunc
=
func
()
(
*
cadvisor
a
pi
.
MachineInfo
,
error
)
{
return
expectedInfo
,
nil
}
...
...
@@ -381,7 +381,7 @@ func TestMachineInfo(t *testing.T) {
t
.
Fatalf
(
"Got error GETing: %v"
,
err
)
}
defer
resp
.
Body
.
Close
()
var
receivedInfo
cadvisor
A
pi
.
MachineInfo
var
receivedInfo
cadvisor
a
pi
.
MachineInfo
err
=
json
.
NewDecoder
(
resp
.
Body
)
.
Decode
(
&
receivedInfo
)
if
err
!=
nil
{
t
.
Fatalf
(
"received invalid json data: %v"
,
err
)
...
...
pkg/kubelet/util.go
View file @
09a38715
...
...
@@ -19,7 +19,7 @@ package kubelet
import
(
"fmt"
cadvisor
A
pi
"github.com/google/cadvisor/info/v1"
cadvisor
a
pi
"github.com/google/cadvisor/info/v1"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/capabilities"
...
...
@@ -27,7 +27,7 @@ import (
"k8s.io/kubernetes/pkg/securitycontext"
)
func
CapacityFromMachineInfo
(
info
*
cadvisor
A
pi
.
MachineInfo
)
api
.
ResourceList
{
func
CapacityFromMachineInfo
(
info
*
cadvisor
a
pi
.
MachineInfo
)
api
.
ResourceList
{
c
:=
api
.
ResourceList
{
api
.
ResourceCPU
:
*
resource
.
NewMilliQuantity
(
int64
(
info
.
NumCores
*
1000
),
...
...
test/e2e/kubelet_stats.go
View file @
09a38715
...
...
@@ -29,7 +29,7 @@ import (
"text/tabwriter"
"time"
cadvisor
"github.com/google/cadvisor/info/v1"
cadvisor
api
"github.com/google/cadvisor/info/v1"
"github.com/prometheus/common/model"
"k8s.io/kubernetes/pkg/api"
client
"k8s.io/kubernetes/pkg/client/unversioned"
...
...
@@ -149,7 +149,7 @@ func HighLatencyKubeletOperations(c *client.Client, threshold time.Duration, nod
// getContainerInfo contacts kubelet for the container informaton. The "Stats"
// in the returned ContainerInfo is subject to the requirements in statsRequest.
func
getContainerInfo
(
c
*
client
.
Client
,
nodeName
string
,
req
*
kubelet
.
StatsRequest
)
(
map
[
string
]
cadvisor
.
ContainerInfo
,
error
)
{
func
getContainerInfo
(
c
*
client
.
Client
,
nodeName
string
,
req
*
kubelet
.
StatsRequest
)
(
map
[
string
]
cadvisor
api
.
ContainerInfo
,
error
)
{
reqBody
,
err
:=
json
.
Marshal
(
req
)
if
err
!=
nil
{
return
nil
,
err
...
...
@@ -163,7 +163,7 @@ func getContainerInfo(c *client.Client, nodeName string, req *kubelet.StatsReque
Body
(
reqBody
)
.
Do
()
.
Raw
()
var
containers
map
[
string
]
cadvisor
.
ContainerInfo
var
containers
map
[
string
]
cadvisor
api
.
ContainerInfo
err
=
json
.
Unmarshal
(
data
,
&
containers
)
if
err
!=
nil
{
return
nil
,
err
...
...
@@ -332,7 +332,7 @@ func GetKubeletPods(c *client.Client, node string) (*api.PodList, error) {
return
result
,
nil
}
func
computeContainerResourceUsage
(
name
string
,
oldStats
,
newStats
*
cadvisor
.
ContainerStats
)
*
containerResourceUsage
{
func
computeContainerResourceUsage
(
name
string
,
oldStats
,
newStats
*
cadvisor
api
.
ContainerStats
)
*
containerResourceUsage
{
return
&
containerResourceUsage
{
Name
:
name
,
Timestamp
:
newStats
.
Timestamp
,
...
...
@@ -371,7 +371,7 @@ func newResourceCollector(c *client.Client, nodeName string, containerNames []st
func
(
r
*
resourceCollector
)
Start
()
{
r
.
stopCh
=
make
(
chan
struct
{},
1
)
// Keep the last observed stats for comparison.
oldStats
:=
make
(
map
[
string
]
*
cadvisor
.
ContainerStats
)
oldStats
:=
make
(
map
[
string
]
*
cadvisor
api
.
ContainerStats
)
go
util
.
Until
(
func
()
{
r
.
collectStats
(
oldStats
)
},
r
.
pollingInterval
,
r
.
stopCh
)
}
...
...
@@ -382,7 +382,7 @@ func (r *resourceCollector) Stop() {
// collectStats gets the latest stats from kubelet's /stats/container, computes
// the resource usage, and pushes it to the buffer.
func
(
r
*
resourceCollector
)
collectStats
(
oldStats
map
[
string
]
*
cadvisor
.
ContainerStats
)
{
func
(
r
*
resourceCollector
)
collectStats
(
oldStats
map
[
string
]
*
cadvisor
api
.
ContainerStats
)
{
infos
,
err
:=
getContainerInfo
(
r
.
client
,
r
.
node
,
&
kubelet
.
StatsRequest
{
ContainerName
:
"/"
,
NumStats
:
1
,
...
...
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