(ctx context.Context, client kubectl.Client, namespace string, pods []*corev1.Pod, log log.Logger)
| 109 | } |
| 110 | |
| 111 | func (u *untilNewestRunning) SelectPod(ctx context.Context, client kubectl.Client, namespace string, pods []*corev1.Pod, log log.Logger) (bool, *corev1.Pod, error) { |
| 112 | now := time.Now() |
| 113 | if now.Before(u.initialDelay) { |
| 114 | return false, nil, nil |
| 115 | } else if len(pods) == 0 { |
| 116 | u.parent.Kill(DevPodLostConnection{}) |
| 117 | return false, nil, DevPodLostConnection{} |
| 118 | } |
| 119 | |
| 120 | sort.Slice(pods, func(i, j int) bool { |
| 121 | return selector.SortPodsByNewest(pods, i, j) |
| 122 | }) |
| 123 | if targetselector.HasPodProblem(pods[0]) { |
| 124 | u.podInfoPrinter.PrintPodWarning(pods[0], log) |
| 125 | return false, nil, nil |
| 126 | } else if kubectl.GetPodStatus(pods[0]) != "Running" { |
| 127 | u.podInfoPrinter.PrintPodInfo(ctx, client, pods[0], log) |
| 128 | return false, nil, nil |
| 129 | } |
| 130 | |
| 131 | return true, pods[0], nil |
| 132 | } |
| 133 | |
| 134 | func (u *untilNewestRunning) SelectContainer(ctx context.Context, client kubectl.Client, namespace string, containers []*selector.SelectedPodContainer, log log.Logger) (bool, *selector.SelectedPodContainer, error) { |
| 135 | now := time.Now() |
nothing calls this directly
no test coverage detected