Skip to content

Commit

Permalink
Merge pull request #7557 from kzys/backport/1.6/stats-nil
Browse files Browse the repository at this point in the history
[release/1.6] Stats() shouldn't assume s.container is non-nil
  • Loading branch information
estesp committed Oct 18, 2022
2 parents 9edb143 + 8a9d693 commit 9a194f7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion runtime/v2/runc/v1/service.go
Expand Up @@ -597,7 +597,11 @@ func (s *service) Shutdown(ctx context.Context, r *taskAPI.ShutdownRequest) (*pt
}

func (s *service) Stats(ctx context.Context, r *taskAPI.StatsRequest) (*taskAPI.StatsResponse, error) {
cgx := s.container.Cgroup()
container, err := s.getContainer()
if err != nil {
return nil, err
}
cgx := container.Cgroup()
if cgx == nil {
return nil, errdefs.ToGRPCf(errdefs.ErrNotFound, "cgroup does not exist")
}
Expand Down

0 comments on commit 9a194f7

Please sign in to comment.