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

fix: pod restart detection #84

Merged
merged 1 commit into from
Aug 5, 2024
Merged

fix: pod restart detection #84

merged 1 commit into from
Aug 5, 2024

Conversation

adityathebe
Copy link
Member

  • we don't care about the restarts if the container has been running for over 4hrs

resolves: #81

* we don't care about the restarts if the container has been running for
  over 4hrs
Comment on lines -88 to -102
} else if containerStatus.RestartCount > 2 && containerStatus.LastTerminationState.Terminated != nil {
lastRestarted := containerStatus.LastTerminationState.Terminated.FinishedAt.Time
if time.Since(lastRestarted) < time.Minute*30 {
return &HealthStatus{
Health: HealthUnhealthy,
Status: HealthStatusCode(containerStatus.LastTerminationState.Terminated.Reason),
Message: strings.Join(messages, ", "),
}, nil
} else if time.Since(lastRestarted) < time.Hour*8 {
return &HealthStatus{
Health: HealthWarning,
Status: HealthStatusCode(containerStatus.LastTerminationState.Terminated.Reason),
Message: strings.Join(messages, ", "),
}, nil
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This check was being performed twice.

@moshloop moshloop merged commit 67b9e2a into main Aug 5, 2024
5 checks passed
@moshloop moshloop deleted the fix/pod-restart-detection branch August 5, 2024 06:27
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.

Pod restart > 4h should not be considered a warning
2 participants