Skip to content

Commit

Permalink
bugfix: only list container stats which are created by cri
Browse files Browse the repository at this point in the history
Signed-off-by: YaoZengzeng <[email protected]>
  • Loading branch information
YaoZengzeng committed Sep 25, 2018
1 parent 7addef1 commit aac0a06
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cri/v1alpha1/cri.go
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ func (c *CriManager) ContainerStats(ctx context.Context, r *runtime.ContainerSta
func (c *CriManager) ListContainerStats(ctx context.Context, r *runtime.ListContainerStatsRequest) (*runtime.ListContainerStatsResponse, error) {
opts := &mgr.ContainerListOption{All: true}
filter := func(c *mgr.Container) bool {
return true
return c.Config.Labels[containerTypeLabelKey] == containerTypeLabelContainer
}
opts.FilterFunc = filter

Expand Down
2 changes: 1 addition & 1 deletion cri/v1alpha2/cri.go
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ func (c *CriManager) ContainerStats(ctx context.Context, r *runtime.ContainerSta
func (c *CriManager) ListContainerStats(ctx context.Context, r *runtime.ListContainerStatsRequest) (*runtime.ListContainerStatsResponse, error) {
opts := &mgr.ContainerListOption{All: true}
filter := func(c *mgr.Container) bool {
return true
return c.Config.Labels[containerTypeLabelKey] == containerTypeLabelContainer
}
opts.FilterFunc = filter

Expand Down

0 comments on commit aac0a06

Please sign in to comment.