Mirantis / cri-dockerd

dockerd as a compliant Container Runtime Interface for Kubernetes
Apache License 2.0
1.01k stars 272 forks source link

Add nil check for result of getContainerStats #331

Closed xinfengliu closed 3 months ago

xinfengliu commented 3 months ago

On Windows, ds.getContainerStats could return nil for stopped containers.

Fixes #330

Proposed Changes

neersighted commented 3 months ago

This seems okay; I think we should probably look at returning err there, but I'm fine with delaying that to a later date as I'm not sure of the implicates from skimming the usage, and this is a rather innocuous fix in the short term.