INNER CODE UNIT · Go

getIgnoreRestartCount

airwallex/k8s-pod-restart-info-collector · helpers.go:108

func getIgnoreRestartCount() int {
	ignoreRestartCount, err := strconv.Atoi(os.Getenv("IGNORE_RESTART_COUNT"))
	if err != nil {
		ignoreRestartCount = 30
		klog.Warningf("Environment variable IGNORE_RESTART_COUNT is not set, default: %d\n", ignoreRestartCount)
	}
	return ignoreRestartCount
}

func printPod(pod *v1.Pod) (string, error) {
	restarts := 0
	totalContainers := len(pod.Spec.Containers)
	readyContainers := 0
	lastRestartDate := metav1.NewTime(time.Time{})

	reason := string(pod.Status.Phase)
	if pod.Status.Reason != "" {
		reason = pod.Status.Reason

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…