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(containerSet): mark container deleted when pod deleted. Fixes: #12210 #12756

Merged
merged 9 commits into from
Mar 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: test
Signed-off-by: shuangkun <tsk2013uestc@163.com>
shuangkun committed Mar 22, 2024
commit 9fe5934e60025da0100db17727c6d58c6500bb8e
2 changes: 1 addition & 1 deletion workflow/controller/operator.go
Original file line number Diff line number Diff line change
@@ -1223,7 +1223,7 @@ func (woc *wfOperationCtx) podReconciliation(ctx context.Context) (error, bool)
node.Daemoned = nil
woc.updated = true
}
woc.markNodePhase(node.Name, wfv1.NodeError, "pod deleted")
woc.markNodeError(node.Name, errors.New("", "pod deleted"))
// Set pod's child(container) error if pod deleted
for _, childNodeID := range node.Children {
childNode, err := woc.wf.Status.Nodes.Get(childNodeID)
5 changes: 3 additions & 2 deletions workflow/controller/operator_test.go
Original file line number Diff line number Diff line change
@@ -10843,8 +10843,8 @@ spec:
podGC:
strategy: OnPodCompletion`

// TestContainerSetDoesNotStopContainerWhenPodRemoved test whether a workflow has ContainerSet error when pod removed.
func TestContainerSetDoesNotStopContainerWhenPodRemoved(t *testing.T) {
// TestContainerSetDeleteContainerWhenPodDeleted test whether a workflow has ContainerSet error when pod deleted.
func TestContainerSetDeleteContainerWhenPodDeleted(t *testing.T) {
_ = os.Setenv("RECENTLY_STARTED_POD_DURATION", "0")
cancel, controller := newController()
defer cancel()
@@ -10890,4 +10890,5 @@ func TestContainerSetDoesNotStopContainerWhenPodRemoved(t *testing.T) {
assert.Equal(t, "container deleted", node.Message)
}
}
_ = os.Unsetenv("RECENTLY_STARTED_POD_DURATION")
}