-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat(restartStuckPod):Restart stuck pods #413
base: main
Are you sure you want to change the base?
Conversation
timeInLog, err := extractTimeFromLog(receivedString) | ||
if err != nil { | ||
fmt.Println("Error parsing time from log:", err) | ||
return true |
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.
We may not want to return true
here, if the time parse fails this will return true from isPodStuck, which I assume would kill the pod inadvertantly.
Can we change this function to return (bool, error)
so we can track the errors better?
func extractTimeFromLog(log string) (time.Time, error) { | ||
parts := strings.Fields(log) | ||
|
||
const timeLayout = "3:04PM" |
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.
We may need to run the time parse on a few layout strings, for example I am looking at an Axelar Testnet sentry node running and it has this time string:
2024-04-17T17:37:18Z
return parsedTime, nil | ||
} | ||
|
||
func getPodLogsLastLine(clientset *kubernetes.Clientset, pod *corev1.Pod) string { |
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.
We may also want to change this to return (string, error)
so that we can track the errors better
Wip : to rework this to accomodate other time strings. |
Speculation: Nodes on SDK 50 are not having this issue. |
Update : |
No description provided.