Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set daemon pod failed when exit with a non-zero status. Fixes:#12911 #12988

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 2 additions & 8 deletions workflow/controller/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1333,14 +1333,8 @@ func (woc *wfOperationCtx) assessNodeStatus(pod *apiv1.Pod, old *wfv1.NodeStatus
new.Phase = wfv1.NodeSucceeded
new.Daemoned = nil
case apiv1.PodFailed:
// ignore pod failure for daemoned steps
if tmpl != nil && tmpl.IsDaemon() {
new.Phase = wfv1.NodeSucceeded
} else {
new.Phase, new.Message = woc.inferFailedReason(pod, tmpl)
woc.log.WithField("displayName", old.DisplayName).WithField("templateName", wfutil.GetTemplateFromNode(*old)).
WithField("pod", pod.Name).Infof("Pod failed: %s", new.Message)
}
new.Phase, new.Message = woc.inferFailedReason(pod, tmpl)
woc.log.WithField("displayName", old.DisplayName).WithField("templateName", old.TemplateName).WithField("pod", pod.Name).Infof("Pod failed: %s", new.Message)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like somebody explicitly thought that Daemons should never been in a Failed state. Do we understand why?

new.Daemoned = nil
case apiv1.PodRunning:
// Daemons are a special case we need to understand the rules:
Expand Down
2 changes: 1 addition & 1 deletion workflow/controller/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1474,7 +1474,7 @@ func TestAssessNodeStatus(t *testing.T) {
},
daemon: true,
node: &wfv1.NodeStatus{TemplateName: templateName},
want: wfv1.NodeSucceeded,
want: wfv1.NodeFailed,
}, {
name: "daemon, pod running, node failed",
pod: &apiv1.Pod{
Expand Down