Skip to content

Commit eb763ff

Browse files
authored
fix: skip terminating pods in getMasterIp (#290)
Signed-off-by: Volodymyr Moseichuk <moskitone@gmail.com>
1 parent c0f4b2c commit eb763ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/controller/dragonfly_instance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func (dfi *DragonflyInstance) getMasterIp(ctx context.Context) (string, error) {
175175
}
176176

177177
for _, pod := range pods.Items {
178-
if pod.Status.Phase == corev1.PodRunning && pod.Status.ContainerStatuses[0].Ready && pod.Labels[resources.Role] == resources.Master {
178+
if pod.Status.Phase == corev1.PodRunning && pod.Status.ContainerStatuses[0].Ready && pod.Labels[resources.Role] == resources.Master && pod.DeletionTimestamp == nil {
179179
return pod.Status.PodIP, nil
180180
}
181181
}

0 commit comments

Comments
 (0)