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

[release-v0.59.x] Mark steps as deleted when TaskRun fails #8296

Merged
Changes from all commits
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
7 changes: 6 additions & 1 deletion pkg/reconciler/taskrun/taskrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,12 @@ func (c *Reconciler) failTaskRun(ctx context.Context, tr *v1.TaskRun, reason v1.
return nil
}

// When the TaskRun is failed, we mark all running/waiting steps as failed
// This is regardless of what happens with the Pod, which may be cancelled,
// deleted, non existing or fail to delete
// See https://github.com/tektoncd/pipeline/issues/8293 for more details.
terminateStepsInPod(tr, reason)

var err error
if reason == v1.TaskRunReasonCancelled && (config.FromContextOrDefaults(ctx).FeatureFlags.EnableKeepPodOnCancel) {
logger.Infof("Canceling task run %q by entrypoint", tr.Name)
Expand All @@ -795,7 +801,6 @@ func (c *Reconciler) failTaskRun(ctx context.Context, tr *v1.TaskRun, reason v1.
return err
}

terminateStepsInPod(tr, reason)
return nil
}

Expand Down