Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
vimystic committed Apr 3, 2024
1 parent 9540577 commit 2f15ed8
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions internal/fullnode/stuck_detection.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ func (d StuckPodDetection) StuckPods(ctx context.Context, crd *cosmosv1.CosmosFu
panic(err.Error())
}

testString := getPodLogsLastLine(clientset, pod)
fmt.Println(testString)
podIsStuck := isPodStuck(testString)
receivedString := getPodLogsLastLine(clientset, pod)
fmt.Println(receivedString)
podIsStuck := isPodStuck(receivedString)

//MORE TODO HERE
if podIsStuck {
Expand All @@ -61,9 +61,8 @@ func (d StuckPodDetection) StuckPods(ctx context.Context, crd *cosmosv1.CosmosFu
return []*corev1.Pod{}
}


func isPodStuck(testString string) bool {
return strings.Contains(inputString, "SignerListener: Connected")
func isPodStuck(receivedString string) bool {
return strings.Contains(receivedString, "SignerListener: Connected")
}

func getPodLogsLastLine(clientset *kubernetes.Clientset, pod *corev1.Pod) string {
Expand All @@ -90,8 +89,6 @@ func getPodLogsLastLine(clientset *kubernetes.Clientset, pod *corev1.Pod) string
return ""
}

}

func removeElement(slice []*corev1.Pod, index int) []*corev1.Pod {
return append(slice[:index], slice[index+1:]...)
}
}

0 comments on commit 2f15ed8

Please sign in to comment.