Skip to content

Commit 3089119

Browse files
committed
fix: only terminate sidecars if the main container exit with code 0
1 parent 6dc28a2 commit 3089119

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

manager/controllers/step_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func (r *StepReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.
188188
// if the main container has terminated, kill all sidecars
189189
mainCtrTerminated := false
190190
for _, s := range pod.Status.ContainerStatuses {
191-
mainCtrTerminated = mainCtrTerminated || (s.Name == dfv1.CtrMain && s.State.Terminated != nil)
191+
mainCtrTerminated = mainCtrTerminated || (s.Name == dfv1.CtrMain && s.State.Terminated != nil && s.State.Terminated.ExitCode == 0)
192192
}
193193
log.Info("pod", "name", pod.Name, "phase", phase, "message", message, "mainCtrTerminated", mainCtrTerminated)
194194
if mainCtrTerminated {

0 commit comments

Comments
 (0)