diff --git a/pkg/new-ui/v1beta1/backend.go b/pkg/new-ui/v1beta1/backend.go index cc59a1b0a20..3b6cd4c4db2 100644 --- a/pkg/new-ui/v1beta1/backend.go +++ b/pkg/new-ui/v1beta1/backend.go @@ -733,10 +733,15 @@ func fetchMasterPodName(clientset *kubernetes.Clientset, trial *trialsv1beta1.Tr field to "true" in the Experiment definition. If this error persists then the Pod's logs are not currently persisted in the cluster.`) } - if len(podList.Items) > 1 { - return "", errors.New("More than one master replica found") + + // If Pod is Running or Succeeded Pod, return it. + for _, pod := range podList.Items { + if pod.Status.Phase == corev1.PodSucceeded || pod.Status.Phase == corev1.PodRunning { + return pod.Name, nil + } } + // Otherwise, return the first Failed Pod. return podList.Items[0].Name, nil }