-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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(controller): Fix node status when daemon pod deleted but its children nodes are still running #4683
Merged
Merged
fix(controller): Fix node status when daemon pod deleted but its children nodes are still running #4683
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ff09725
fix(controller): Remove daemoned in NodeStatus when daemon pod delete…
lonsdale8734 9c0dbfd
fix(controller): Fix depends logic when daemon depend failed. Fixes (…
lonsdale8734 ef29495
Merge branch 'master' into fix-daemon-pod
simster7 bd86d8c
fix
simster7 2ac4258
Merge branch 'master' into fix-daemon-pod
simster7 f5a61db
Merge branch 'master' into fix-daemon-pod
simster7 127eb31
Merge branch 'master' into fix-daemon-pod
alexec cab1aa7
Merge branch 'master' into fix-daemon-pod
simster7 5aea4ee
Merge branch 'master' into HEAD
simster7 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -926,7 +926,7 @@ func (woc *wfOperationCtx) podReconciliation(ctx context.Context) error { | |
// It is now impossible to infer pod status. We can do at this point is to mark the node with Error, or | ||
// we can re-submit it. | ||
for nodeID, node := range woc.wf.Status.Nodes { | ||
if node.Type != wfv1.NodeTypePod || node.Fulfilled() || node.StartedAt.IsZero() { | ||
if node.Type != wfv1.NodeTypePod || node.Phase.Fulfilled() || node.StartedAt.IsZero() { | ||
// node is not a pod, it is already complete, or it can be re-run. | ||
continue | ||
} | ||
|
@@ -950,6 +950,10 @@ func (woc *wfOperationCtx) podReconciliation(ctx context.Context) error { | |
continue | ||
} | ||
|
||
if node.Daemoned != nil && *node.Daemoned { | ||
node.Daemoned = nil | ||
woc.updated = true | ||
} | ||
woc.markNodePhase(node.Name, wfv1.NodeError, "pod deleted") | ||
} else { | ||
// At this point we are certain that the pod associated with our node is running or has been run; | ||
|
@@ -1100,6 +1104,7 @@ func (woc *wfOperationCtx) assessNodeStatus(pod *apiv1.Pod, node *wfv1.NodeStatu | |
if pod.DeletionTimestamp != nil { | ||
// pod is being terminated | ||
newPhase = wfv1.NodeError | ||
newDaemonStatus = pointer.BoolPtr(false) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and the purpose of this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto. |
||
message = "pod deleted during operation" | ||
woc.log.WithField("displayName", node.DisplayName).WithField("templateName", node.TemplateName). | ||
WithField("pod", pod.Name).Error(message) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain this particular change more? Not sure if we want this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The case for this code is "explained" in the unittest.