Skip to content

Commit

Permalink
Merge pull request #305 from Luminger/add-WaitForPodToRun-status-filter
Browse files Browse the repository at this point in the history
core: Add status.phase=Running filter to WaitForPodToRun
  • Loading branch information
subhamkrai authored Jun 28, 2024
2 parents 9c6a69e + 6ed8906 commit ee52e2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/k8sutil/k8sutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func RestartDeployment(ctx context.Context, k8sclientset kubernetes.Interface, n
}

func WaitForPodToRun(ctx context.Context, k8sclientset kubernetes.Interface, namespace, labelSelector string) (corev1.Pod, error) {
opts := v1.ListOptions{LabelSelector: labelSelector}
opts := v1.ListOptions{LabelSelector: labelSelector, FieldSelector: "status.phase=Running"}
for i := 0; i < 60; i++ {
pod, err := k8sclientset.CoreV1().Pods(namespace).List(ctx, opts)
if err != nil {
Expand Down

0 comments on commit ee52e2d

Please sign in to comment.