diff --git a/pkg/apis/workflow/v1alpha1/workflow_types.go b/pkg/apis/workflow/v1alpha1/workflow_types.go index 4e583adaff5f..4cd74e2450e5 100644 --- a/pkg/apis/workflow/v1alpha1/workflow_types.go +++ b/pkg/apis/workflow/v1alpha1/workflow_types.go @@ -2441,6 +2441,11 @@ func (n *NodeStatus) IsActiveSuspendNode() bool { return n.Type == NodeTypeSuspend && n.Phase == NodeRunning } +// IsActivePluginNode returns whether this node is an active plugin node +func (n *NodeStatus) IsActivePluginNode() bool { + return n.Type == NodeTypePlugin && (n.Phase == NodeRunning || n.Phase == NodePending) +} + func (n NodeStatus) GetDuration() time.Duration { if n.FinishedAt.IsZero() { return 0 diff --git a/workflow/controller/operator.go b/workflow/controller/operator.go index 6b071fadfc1c..b2b4e4605b44 100644 --- a/workflow/controller/operator.go +++ b/workflow/controller/operator.go @@ -421,8 +421,10 @@ func (woc *wfOperationCtx) operate(ctx context.Context) { if err != nil { woc.markNodeError(node.Name, err) } - // Reconcile TaskSet and Agent for HTTP templates - woc.taskSetReconciliation(ctx) + // Reconcile TaskSet and Agent for HTTP templates when is not shutdown + if !woc.execWf.Spec.Shutdown.Enabled() { + woc.taskSetReconciliation(ctx) + } // Check all hooks are completes if !hookCompleted { @@ -1222,8 +1224,8 @@ func (woc *wfOperationCtx) shouldPrintPodSpec(node *wfv1.NodeStatus) bool { func (woc *wfOperationCtx) failSuspendedAndPendingNodesAfterDeadlineOrShutdown() { for _, node := range woc.wf.Status.Nodes { - // fail suspended nodes when shuting down - if woc.GetShutdownStrategy().Enabled() && node.IsActiveSuspendNode() { + // fail suspended nodes or plugin nodes when shuting down + if woc.GetShutdownStrategy().Enabled() && (node.IsActiveSuspendNode() || node.IsActivePluginNode()) { message := fmt.Sprintf("Stopped with strategy '%s'", woc.GetShutdownStrategy()) woc.markNodePhase(node.Name, wfv1.NodeFailed, message) continue