Skip to content

Commit

Permalink
fix: skip terminating pods in getMasterIp
Browse files Browse the repository at this point in the history
  • Loading branch information
moskitone committed Jan 31, 2025
1 parent 7d94acf commit d88379a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/controller/dragonfly_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (dfi *DragonflyInstance) getMasterIp(ctx context.Context) (string, error) {
}

for _, pod := range pods.Items {
if pod.Status.Phase == corev1.PodRunning && pod.Status.ContainerStatuses[0].Ready && pod.Labels[resources.Role] == resources.Master {
if pod.Status.Phase == corev1.PodRunning && pod.Status.ContainerStatuses[0].Ready && pod.Labels[resources.Role] == resources.Master && pod.DeletionTimestamp == nil {
return pod.Status.PodIP, nil
}
}
Expand Down

0 comments on commit d88379a

Please sign in to comment.