Skip to content

Commit

Permalink
Count node shift of pod as failure (#22)
Browse files Browse the repository at this point in the history
Signed-off-by: souravbiswassanto <[email protected]>
  • Loading branch information
souravbiswassanto authored Nov 19, 2024
1 parent 1757dcc commit c537a04
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/controllers/apps/sidekick_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,13 @@ func (r *SidekickReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c
if expectedHash != actualHash ||
leader.Name != pod.Annotations[keyLeader] ||
leader.Spec.NodeName != pod.Spec.NodeName || (pod.Status.Phase == corev1.PodFailed && sidekick.Spec.RestartPolicy == corev1.RestartPolicyNever) {
if leader.Spec.NodeName != pod.Spec.NodeName && pod.Spec.NodeName != "" {
sidekick.Status.FailureCount[string(pod.GetUID())] = true
}
err := r.deletePod(ctx, &pod)
if err != nil {
return ctrl.Result{}, err
}

sidekick.Status.Leader.Name = ""
sidekick.Status.Pod = ""
sidekick.Status.ObservedGeneration = sidekick.GetGeneration()
Expand Down

0 comments on commit c537a04

Please sign in to comment.