Skip to content

Rename OpenShiftPipelinesAsCode CRD to TektonPipelinesAsCode #3841

Description

@theakshaypant

Summary

The OpenShiftPipelinesAsCode CRD (kind: OpenShiftPipelinesAsCode, resource:
openshiftpipelinesascodes.operator.tekton.dev) should be renamed to
TektonPipelinesAsCode to align with the project's upstream move and with the
naming convention used by every other component in this operator.

Background

Pipelines-as-Code (PAC) has moved its upstream repository from the
openshift-pipelines GitHub organization to tektoncd:
https://github.com/tektoncd/pipelines-as-code

The operator's CRD name predates that move and carries an OpenShift-specific
prefix that is now misleading — PAC runs on vanilla Kubernetes as well and the
operator already installs it on both platforms via the same CRD. Every other
component managed by this operator follows a Tekton-prefixed naming scheme:

Kind Resource
TektonPipeline tektonpipelines
TektonTrigger tektontriggers
TektonChain tektonchains
TektonDashboard tektondashboards
TektonResult tektonresults
TektonPruner tektonpruners
TektonScheduler tektonschedulers
OpenShiftPipelinesAsCode openshiftpipelinesascodes ← outlier

OpenShiftPipelinesAsCode is the only component with a platform-branded prefix.

Proposed Rename

Before After
Kind OpenShiftPipelinesAsCode TektonPipelinesAsCode
Plural resource openshiftpipelinesascodes tektonpipelinesascodes
Singular openshiftpipelinesascode tektonpipelinesascode
Short names opac, pac tpac, pac
CRD name openshiftpipelinesascodes.operator.tekton.dev tektonpipelinesascodes.operator.tekton.dev

The singleton CR instance name (pipelines-as-code) and target namespaces remain
unchanged.

Scope of Changes

tekton-operator (this repo)

API types (pkg/apis/operator/v1alpha1/)

  • Rename openshiftpipelinesascode_types.gotektonpipelinesascode_types.go; update struct name, markers, and all references
  • Update register.go: KindOpenShiftPipelinesAsCodeKindTektonPipelinesAsCode
  • Update const.go: rename OpenShiftPipelinesAsCodeName constant (value unchanged: "pipelines-as-code")
  • Rename openshiftpipelinesascode_lifecycle.gotektonpipelinesascode_lifecycle.go
  • Rename openshiftpipelinesascode_defaults.gotektonpipelinesascode_defaults.go
  • Rename openshiftpipelinesascode_validation.gotektonpipelinesascode_validation.go

Code generation (run after type changes)

  • Re-run ./hack/update-codegen.sh
  • Generated client package pkg/client/…/openshiftpipelinesascode/tektonpipelinesascode/
  • Generated informer / lister packages updated accordingly

Reconcilers

  • Rename package pkg/reconciler/openshift/openshiftpipelinesascode/tektonpipelinesascode/
  • Rename package pkg/reconciler/kubernetes/pipelinesascode/tektonpipelinesascode/ (or align naming)
  • Update pkg/reconciler/shared/tektonconfig/pipelinesascode/ references
  • Update pkg/reconciler/platform/const.go: ControllerOpenShiftPipelinesAsCodeControllerTektonPipelinesAsCode

Config / manifests

  • Rename config/base/generated-crds/operator.tekton.dev_openshiftpipelinesascodes.yaml…_tektonpipelinesascodes.yaml
  • Update config/kubernetes/base/pipelinesascode.yaml (RBAC ClusterRole names, resource list)
  • Update CR samples:
    • config/crs/kubernetes/pipelinesascode/operator_v1alpha1_pipelinesascode_cr.yaml
    • config/crs/openshift/pipelinesascode/operator_v1alpha1_openshiftpipelinesascode_cr.yaml

TektonConfig integration

  • Update TektonConfigSpec references that wire PAC installation (field names in Platforms.OpenShift.PipelinesAsCode / Platforms.Kubernetes.PipelinesAsCode may stay as-is since they are not the CRD kind)

Tests

  • Update unit and E2E test helpers that reference OpenShiftPipelinesAsCode kind strings or use the old resource name
  • Update any test/resources/ helpers

CSV / OLM bundles

  • Update bundle CSVs under operatorhub/ / bundle/ to reference new CRD name
  • Update owned: CRDs entries in CSV

Tekton Website

The Tekton website documentation must be updated to reflect the rename wherever
OpenShiftPipelinesAsCode appears:

  • Install / getting-started guides that show kind: OpenShiftPipelinesAsCode
    in YAML snippets
  • API reference pages for the operator CRD (openshiftpipelinesascodes)
  • Operator component overview / architecture pages that list managed CRDs
  • kubectl / oc command examples using -o openshiftpipelinesascode or
    get opac

Migration / Compatibility

This is a breaking change for existing users who have a live
OpenShiftPipelinesAsCode CR on their cluster.

Suggested approach: deprecation window

Keep the old OpenShiftPipelinesAsCode CRD name as a deprecated alias for one
or two minor releases — emit a warning event on reconcile, document the rename
prominently in release notes, and remove the old CRD in a later release. This
gives users time to update their manifests and automation without forcing an
immediate migration.

Open for discussion — other approaches worth considering:

  • Conversion webhook — serve both CRD versions via a webhook, allowing
    in-place migration without users touching their CRs.
  • Operator-managed migration — on startup, if the operator detects an
    OpenShiftPipelinesAsCode CR and no TektonPipelinesAsCode CR, create
    the new CR from the existing spec and mark the old one for deletion.

Feedback on the preferred approach is welcome before implementation begins.

Whichever strategy is chosen must be documented in the release notes and upgrade guide.

Acceptance Criteria

  • TektonPipelinesAsCode CRD is available on the cluster after operator
    install; OpenShiftPipelinesAsCode CRD is removed (or deprecated per the
    migration plan).
  • kubectl get tektonpipelinesascode and short form kubectl get pac work.
  • make lint and make test pass with zero failures.
  • ./hack/update-codegen.sh has been re-run and generated files are committed.
  • OLM/CSV bundles reference only tektonpipelinesascodes.operator.tekton.dev.
  • Tekton website pages updated with new kind/resource names.
  • Upgrade path documented (migration guide or release note).

References

  • Pipelines-as-Code upstream repo: https://github.com/tektoncd/pipelines-as-code
  • Current CRD type: pkg/apis/operator/v1alpha1/openshiftpipelinesascode_types.go
  • Naming convention reference: pkg/apis/operator/v1alpha1/tektonpipeline_types.go

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions