Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nil check for result of getContainerStats #331

Merged

Conversation

xinfengliu
Copy link
Contributor

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

Fixes #330

Proposed Changes

  • Check nil on the result of ds.getContainerStats

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

Signed-off-by: Xinfeng Liu <XinfengLiu@icloud.com>
@xinfengliu xinfengliu force-pushed the fix-nil-containerstats-on-windows branch from b748909 to ab0c613 Compare March 8, 2024 09:38
@xinfengliu xinfengliu changed the title Add nil check in ListContainerStats Add nil check for result of getContainerStats Mar 8, 2024
Copy link
Collaborator

@nwneisen nwneisen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@neersighted
Copy link
Collaborator

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.

@neersighted neersighted merged commit 1450172 into Mirantis:master Mar 8, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows: cri-dockerd keeps crashing
3 participants