5.6. Annotations for specifying automatic cancellation-in-progress for a pipeline run


By default, Pipelines as Code does not cancel pipeline runs automatically. Every pipeline run that Pipelines as Code creates and starts executes until it completes. However, events that trigger pipeline runs can come in quick succession. For example, if a pull request triggers a pipeline run and then the user pushes new commits into the pull request source branch, each push triggers a new copy of the pipeline run. If several pushes happen, several copies can run, which can consume excessive cluster resources.

You can configure a pipeline run to enable automatic cancellation-in-progress. If you enable automatic cancellation for a pipeline run, Pipelines as Code cancels the pipeline run in the following situations:

  • Pipelines as Code has successfully started a copy of the same pipeline run for the same pull request or the same source branch.
  • The pull request that triggered the pipeline run is merged or closed.

You can use the following example to enable automatic cancellation when you create the sample-pipeline pipeline run:

apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
  name: sample-pipeline
annotations:
  pipelinesascode.tekton.dev/cancel-in-progress: "true"
# ...
重要

Automatic cancellation-in-progress of pipeline runs is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.

For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.

注記
  • Pipelines as Code cancels a pipeline run after starting a new copy of this pipeline run successfully. The pipelinesascode.tekton.dev/cancel-in-progress setting does not ensure that only one copy of the pipeline run is executing at any time.
  • To enable cancellation-in-progress for all default pipeline runs, use the enable-cancel-in-progress-on-pull-requests and the enable-cancel-in-progress-on-push settings. These settings are available in the platforms.openshift.pipelinesAsCode.settings spec of the TektonConfig custom resource (CR) configure Pipelines as Code.
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る