Skip to content

(feat): Add Pipelines-as-Code on Kubernetes; resolve openshift-pipelines/pipelines-as-code to tektoncd repo#3337

Merged
tekton-robot merged 1 commit into
tektoncd:mainfrom
mbpavan:pbheeman-add-pac
Apr 21, 2026
Merged

(feat): Add Pipelines-as-Code on Kubernetes; resolve openshift-pipelines/pipelines-as-code to tektoncd repo#3337
tekton-robot merged 1 commit into
tektoncd:mainfrom
mbpavan:pbheeman-add-pac

Conversation

@mbpavan

@mbpavan mbpavan commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Changes

Enable Pipelines-as-Code (PAC) on vanilla Kubernetes in the Tekton Operator, aligned with the tektoncd/pipelines-as-code GitHub repo while keeping the canonical Go module path github.com/openshift-pipelines/pipelines-as-code.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • [ x] Run make test lint before submitting a PR
  • [ x] Includes tests (if functionality changed/added)
  • [ x] Includes docs (if user facing)
  • [ x] Commit messages follow commit message best practices

See the contribution guide for more details.

Release Notes

The Tekton Operator can now install and reconcile Pipelines-as-Code (PAC) on vanilla Kubernetes,PAC payloads are sourced from tektoncd/pipelines-as-code, while the Go module path remains github.com/openshift-pipelines/pipelines-as-code and is wired to that repo with a go.mod replace. 

@tekton-robot tekton-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Apr 8, 2026
@tekton-as-code

tekton-as-code Bot commented Apr 8, 2026

Copy link
Copy Markdown

Caution

There are some errors in your PipelineRun template.

PipelineRun Error
release-pipeline CEL expression evaluation error: expression "has(body.created) && body.created == true && pac.target_branch.startsWith(\"refs/heads/release-v\")\n" check failed: ERROR: <input>:1:46: undeclared reference to 'pac' (in container '') | has(body.created) && body.created == true && pac.target_branch.startsWith("refs/heads/release-v") | .............................................^

@tekton-robot tekton-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Apr 8, 2026
@mbpavan mbpavan changed the title (WIP) Add Pipelines-as-Code on Kubernetes and resolve openshift-pipelines/p… (WIP) Add Pipelines-as-Code on Kubernetes; resolve openshift-pipelines/pipelines-as-code to tektoncd repo Apr 8, 2026
@mbpavan

mbpavan commented Apr 8, 2026

Copy link
Copy Markdown
Contributor Author

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 8, 2026
@mbpavan mbpavan changed the title (WIP) Add Pipelines-as-Code on Kubernetes; resolve openshift-pipelines/pipelines-as-code to tektoncd repo (WIP) (feat): Add Pipelines-as-Code on Kubernetes; resolve openshift-pipelines/pipelines-as-code to tektoncd repo Apr 8, 2026
@mbpavan mbpavan force-pushed the pbheeman-add-pac branch from 5551ab6 to 5cb4ff9 Compare April 8, 2026 06:30
@mbpavan mbpavan changed the title (WIP) (feat): Add Pipelines-as-Code on Kubernetes; resolve openshift-pipelines/pipelines-as-code to tektoncd repo (feat): Add Pipelines-as-Code on Kubernetes; resolve openshift-pipelines/pipelines-as-code to tektoncd repo Apr 9, 2026
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 9, 2026
@jkhelil

jkhelil commented Apr 9, 2026

Copy link
Copy Markdown
Member

@mbpavan Overall looks good

  • Please fix the helm charts too add, the pac crd to kubernetes crds yaml and probably update deployment
  • Is this PR works for initial install for openshift and kubernetes ?
  • Is this PR works with upgrade on openshift ?
  • Can you have a PR for old releases, for patch releases where we cherr-pick only required things related to migration: fetch releases, go module rewriting, lookup for release on tektoninstallerset, anything but not the kubernetes addon feature

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 9, 2026
@mbpavan

mbpavan commented Apr 9, 2026

Copy link
Copy Markdown
Contributor Author

@mbpavan Overall looks good

  • Please fix the helm charts too add, the pac crd to kubernetes crds yaml and probably update deployment
  • Is this PR works for initial install for openshift and kubernetes ?
  • Is this PR works with upgrade on openshift ?
  • Can you have a PR for old releases, for patch releases where we cherr-pick only required things related to migration: fetch releases, go module rewriting, lookup for release on tektoninstallerset, anything but not the kubernetes addon feature

Thanks @jkhelil
Q: Does this PR work for initial installation on both OpenShift and Kubernetes?
A: Yes, it works. I have also verified this by enabling and disabling PAC.
Q: Does this PR work during upgrades on OpenShift?
A: Yes, it works for upgrades on both Kubernetes and OpenShift.
Q: Can you create a separate PR for older/patch releases that cherry-picks only the migration-related changes (fetch releases, Go module rewriting, TektonInstallerSet release lookup, etc.), excluding the Kubernetes addon feature?
A: Will create that once this PR is merged. I want to incorporate any review feedback from this PR before preparing the patch-release PR.

for helm chart, I will do, good catch

Comment thread docs/TektonConfig.md
- On Kubernetes
- [TektonDashboard](./TektonDashboard.md)
- [OpenShiftPipelinesAsCode](./OpenShiftPipelinesAsCode.md) (installed via `spec.platforms.kubernetes.pipelinesAsCode`; same CRD/kind as on OpenShift)
- On OpenShift

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider revisiting this section. The content is reduntant. Please check teh doc here - https://tekton.dev/docs/operator/tektonaddon/ addon right now is intentionally opnshift only.. with this PR we are making that as well kuberenetes, which will increase the scope of work downstream and upstream.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding tektonaddon, as you correctly pointed out that its for OCP addons, I have removed PAC to be part of tektonaddon and with the docs look good with that change

Comment thread pkg/reconciler/common/releases.go Outdated
case *v1alpha1.ManualApprovalGate:
return filepath.Join(koDataDir, "manual-approval-gate")
case *v1alpha1.OpenShiftPipelinesAsCode:
return filepath.Join(koDataDir, "tekton-addon/pipelines-as-code")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO PAC should not be a sub-directory of tekton-addon please consider fixing this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

},
v1alpha1.ProfileBasic: {
Deployments: []string{
"pipelines-as-code-controller",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need PAC for Basic profile & Lite profile?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked and currently for OCP we do not add it as a part of any profile as well and let us keep it that way as of now.

*config.Spec.Platforms.OpenShift.PipelinesAsCode.Enable {
pacEnabled = true
}
if config.Spec.Platforms.Kubernetes.PipelinesAsCode != nil &&

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the user attempts to do spec.openshift.PipelinesAsCode as well as spec.kubernetes.PipelinesasCode? Do we have validation to allow only either of them? Also if we set as kuberenetes, it should work on both OPenshift and kubernetes? Is there any logic that will work only if it is set to Openshift?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added webhook validation now

@anithapriyanatarajan anithapriyanatarajan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbpavan - This PR also enables support of tekton addons upstream. Please update PR description and commit accordingly, if that is intended.

Also, please include tests to https://github.com/mbpavan/operator/blob/main/pkg/reconciler/common/releases_test.go since we are making changes to releases.go.

@tekton-robot tekton-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 13, 2026
@mbpavan mbpavan force-pushed the pbheeman-add-pac branch 4 times, most recently from 16782dd to 5662ad2 Compare April 14, 2026 17:21
@mbpavan

mbpavan commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author

@mbpavan Overall looks good

  • Please fix the helm charts too add, the pac crd to kubernetes crds yaml and probably update deployment
  • Is this PR works for initial install for openshift and kubernetes ?
  • Is this PR works with upgrade on openshift ?
  • Can you have a PR for old releases, for patch releases where we cherr-pick only required things related to migration: fetch releases, go module rewriting, lookup for release on tektoninstallerset, anything but not the kubernetes addon feature

Thanks @jkhelil Q: Does this PR work for initial installation on both OpenShift and Kubernetes? A: Yes, it works. I have also verified this by enabling and disabling PAC. Q: Does this PR work during upgrades on OpenShift? A: Yes, it works for upgrades on both Kubernetes and OpenShift. Q: Can you create a separate PR for older/patch releases that cherry-picks only the migration-related changes (fetch releases, Go module rewriting, TektonInstallerSet release lookup, etc.), excluding the Kubernetes addon feature? A: Will create that once this PR is merged. I want to incorporate any review feedback from this PR before preparing the patch-release PR.

for helm chart, I will do, good catch

I have added helm chart changes now

@mbpavan

mbpavan commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author

@mbpavan - This PR also enables support of tekton addons upstream. Please update PR description and commit accordingly, if that is intended.

Also, please include tests to https://github.com/mbpavan/operator/blob/main/pkg/reconciler/common/releases_test.go since we are making changes to releases.go.

you are right, now tektonadd is not enalbed upstream with the new commit

@jkhelil

jkhelil commented Apr 21, 2026

Copy link
Copy Markdown
Member

/approve

@tekton-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jkhelil

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

The pull request process is described 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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 21, 2026
@anithapriyanatarajan

Copy link
Copy Markdown
Contributor

@mbpavan - Thank you for the PR and the updates. Please consider addressing the following comments in a follow up PR.

  1. add tests to https://github.com/mbpavan/operator/blob/main/pkg/reconciler/common/releases_test.go
  2. Consider incorporating the preUgrade logic for kuberenetes platform as well - https://github.com/mbpavan/operator/blob/6326d80615728153677df0d1feff3545f4dc53f9/pkg/reconciler/shared/tektonconfig/upgrade/pre_upgrade.go#L162-L166
  3. NIT: While deploying in a Openshift cluster observed that the platform section includes empty kubernetes: {} section. Though it is not breaking anything, consider fixing this as well
image

@anithapriyanatarajan

Copy link
Copy Markdown
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 21, 2026
@tekton-robot tekton-robot merged commit 71ed26f into tektoncd:main Apr 21, 2026
16 checks passed
@aThorp96

aThorp96 commented May 12, 2026

Copy link
Copy Markdown
Member

Please make sure to call out in the release notes that this is a breaking change: Pipelines as Code installations using spec.platforms.openshift will uninstall unless the user migrates to spec.platforms.kubernetes

It would be nice for the pre-upgrade to migrate the configuration

Sorry, this change was a red herring to an error I was seeing. This is not a breaking change after all

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. 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.

5 participants