// create count pods with the given phase for the given job func newPodList(count int, status api.PodPhase, job *extensions.Job) []api.Pod { pods := []api.Pod{} for i := 0; i < count; i++ { newPod := api.Pod{ ObjectMeta: api.ObjectMeta{ Name: fmt.Sprintf("pod-%v", rand.String(10)), Labels: job.Spec.Selector.MatchLabels, Namespace: job.Namespace, }, Status: api.PodStatus{Phase: status}, } pods = append(pods, newPod) } return pods }
func (simpleNameGenerator) GenerateName(base string) string { if len(base) > maxGeneratedNameLength { base = base[:maxGeneratedNameLength] } return fmt.Sprintf("%s%s", base, utilrand.String(randomLength)) }