(count, isUnready, isUnhealthy int, labels map[string]string)
| 290 | } |
| 291 | |
| 292 | func newPodList(count, isUnready, isUnhealthy int, labels map[string]string) *corev1.PodList { |
| 293 | pods := []corev1.Pod{} |
| 294 | for i := 0; i < count; i++ { |
| 295 | newPod := corev1.Pod{ |
| 296 | ObjectMeta: metav1.ObjectMeta{ |
| 297 | Name: fmt.Sprintf("pod-%d", i+1), |
| 298 | Namespace: metav1.NamespaceDefault, |
| 299 | CreationTimestamp: metav1.Date(2016, time.April, 1, 1, 0, i, 0, time.UTC), |
| 300 | Labels: labels, |
| 301 | }, |
| 302 | Status: corev1.PodStatus{ |
| 303 | Conditions: []corev1.PodCondition{ |
| 304 | { |
| 305 | Status: corev1.ConditionTrue, |
| 306 | Type: corev1.PodReady, |
| 307 | }, |
| 308 | }, |
| 309 | }, |
| 310 | } |
| 311 | pods = append(pods, newPod) |
| 312 | } |
| 313 | if isUnready > -1 && isUnready < count { |
| 314 | pods[isUnready].Status.Conditions[0].Status = corev1.ConditionFalse |
| 315 | } |
| 316 | if isUnhealthy > -1 && isUnhealthy < count { |
| 317 | pods[isUnhealthy].Status.ContainerStatuses = []corev1.ContainerStatus{{RestartCount: 5}} |
| 318 | } |
| 319 | return &corev1.PodList{ |
| 320 | Items: pods, |
| 321 | } |
| 322 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…