-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
kuberuntime: report StartedAt regardless of container states #45977
Conversation
if c.State == runtimeapi.ContainerState_CONTAINER_RUNNING { | ||
cStatus.StartedAt = time.Unix(0, status.StartedAt) | ||
} else { | ||
if c.State == runtimeapi.ContainerState_CONTAINER_EXITED { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, I attempted to write a simple unit test, but that'd require quite a bit of refactoring. Unit test coverage should be added to this package in general.
👍 |
Also refactor a little bit to make the function more testable.
Added the second commit to refactor and add a unit test. |
@k8s-bot kops aws e2e test this |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Random-Liu, yujuhong
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue (batch tested with PRs 45977, 45890) |
Automatic merge from submit-queue |
Commit found in the "release-1.6" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked. |
This fixes #45943
Release note: