Skip to content

TEP-0128: ScheduledTemplate controller and cronrunner Implementation - #2197

Open
sudhishmk wants to merge 1 commit into
tektoncd:mainfrom
sudhishmk:tep-0128-controller
Open

sudhishmk wants to merge 1 commit into
tektoncd:mainfrom
sudhishmk:tep-0128-controller

Conversation

@sudhishmk

@sudhishmk sudhishmk commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

Implements the TEP-0128 runtime for ScheduledTemplate:

  • Add ScheduledTemplate reconciler that owns a CronJob and runs cronrunner on schedule
  • Create resources from TriggerTemplate / inline templates; sync status from CronJob
  • RBAC: scheduledtemplates/finalizers; CronJob informer registered for watches
  • Owned-field CronJob reconcile; configurable/omittable runAs UID/GID; DNS-safe CronJob names
  • Bounded CloudEvent delivery to cloudEventSink
  • Docs and examples under docs/scheduledtemplates.md and examples/v1alpha1/scheduledtemplate/

Related: TEP-0128, #1903
(Builds on the merged CRD/webhook from #1774.)

/kind feature

Submitter Checklist

  • Has Docs if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards
  • Has a kind label (/kind feature or /kind tep after open)
  • Release notes block updated
  • Release notes contains "action required" if needed

Release Notes

Add ScheduledTemplate controller and cronrunner to create resources on a cron schedule (TEP-0128).

Features

  • Add ScheduledTemplate controller that owns a CronJob and creates resources on schedule via cronrunner (TEP-0128)
  • Add optional serviceAccountName, CronJob-backed status fields, and cloudEventSink notifications for ScheduledTemplate

Test plan

  • Unit tests: API defaults/validation/status, reconciler CronJob create/update, cronrunner inline+ref
  • Local smoke: apply ScheduledTemplate → CronJob Jobs complete → TaskRuns Succeeded with triggers.tekton.dev/scheduledtemplate label
  • CI unit / lint / e2e as applicable
  • Note: full-repo make golangci-lint may still report 3 pre-existing issues in pkg/sink/sink.go and pkg/bootstrap/file_helper.go (unrelated to this PR)

Reconcile ScheduledTemplates into owned CronJobs and create resources on
schedule via cronrunner, with status, RBAC finalizers, configurable runner
identity, DNS-safe CronJob names, owned-field reconcile, and bounded
CloudEvent delivery.
@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 22, 2026
@tekton-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign savitaashture after the PR has been reviewed.
You can assign the PR to them by writing /assign @savitaashture in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Oct 22, 2026
@codecov

codecov Bot commented Oct 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.42%. Comparing base (33bad14) to head (b8e52bc).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2197      +/-   ##
==========================================
+ Coverage   80.08%   80.42%   +0.34%     
==========================================
  Files          96      102       +6     
  Lines        4645     5038     +393     
==========================================
+ Hits         3720     4052     +332     
- Misses        667      709      +42     
- Partials      258      277      +19     
Flag Coverage Δ
unit-tests 80.42% <ø> (+0.34%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sudhishmk

Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@khrm

khrm commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants