Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion components.nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ hub:
github: openshift-pipelines/hub
version: v1.18.0
pipelines-as-code:
github: openshift-pipelines/pipelines-as-code
github: tektoncd/pipelines-as-code
version: nightly
pruner:
github: tektoncd/pruner
Expand Down
2 changes: 1 addition & 1 deletion components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pipeline:
github: tektoncd/pipeline
version: v1.11.0
pipelines-as-code:
github: openshift-pipelines/pipelines-as-code
github: tektoncd/pipelines-as-code
version: v0.44.0
pruner:
github: tektoncd/pruner
Expand Down
51 changes: 51 additions & 0 deletions config/base/300-operator_v1alpha1_addon_crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Copyright 2020 The Tekton Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: tektonaddons.operator.tekton.dev
labels:
version: "devel"
operator.tekton.dev/release: "devel"
spec:
group: operator.tekton.dev
names:
kind: TektonAddon
listKind: TektonAddonList
plural: tektonaddons
singular: tektonaddon
preserveUnknownFields: false
scope: Cluster
versions:
- name: v1alpha1
served: true
storage: true
subresources:
status: {}
additionalPrinterColumns:
- jsonPath: .status.version
name: Version
type: string
- jsonPath: .status.conditions[?(@.type=="Ready")].status
name: Ready
type: string
- jsonPath: ".status.conditions[?(@.type==\"Ready\")].message"
name: Reason
type: string
schema:
openAPIV3Schema:
type: object
description: Schema for the tektonaddons API
x-kubernetes-preserve-unknown-fields: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright 2022 The Tekton Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: openshiftpipelinesascodes.operator.tekton.dev
labels:
version: "devel"
operator.tekton.dev/release: "devel"
spec:
group: operator.tekton.dev
names:
kind: OpenShiftPipelinesAsCode
listKind: OpenShiftPipelinesAsCodeList
plural: openshiftpipelinesascodes
singular: openshiftpipelinesascode
shortNames:
- opac
- pac
preserveUnknownFields: false
scope: Cluster
versions:
- name: v1alpha1
served: true
storage: true
subresources:
status: {}
additionalPrinterColumns:
- jsonPath: .status.version
name: Version
type: string
- jsonPath: .status.conditions[?(@.type=="Ready")].status
name: Ready
type: string
- jsonPath: ".status.conditions[?(@.type==\"Ready\")].message"
name: Reason
type: string
schema:
openAPIV3Schema:
type: object
description: Schema for the OpenShiftPipelinesAsCode API
x-kubernetes-preserve-unknown-fields: true
2 changes: 2 additions & 0 deletions config/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ resources:
- 300-operator_v1alpha1_scheduler_crd.yaml
- 300-operator_v1alpha1_multiclusterproxyaae_crd.yaml
- 300-operator_v1alpha1_syncerservice_crd.yaml
- 300-operator_v1alpha1_addon_crd.yaml
- 300-operator_v1alpha1_openshiftpipelinesascode_crd.yaml
- config-logging.yaml
- config-observability.yaml
- tekton-config-defaults.yaml
Expand Down
1 change: 1 addition & 0 deletions config/crs/kubernetes/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ resources:
- pruner/operator_v1alpha1_pruner_cr.yaml
- scheduler/operator_v1alpha1_scheduler_cr.yaml
- multicluster-proxy-aae/operator_v1alpha1_multiclusterproxyaae_cr.yaml
- pipelinesascode/operator_v1alpha1_pipelinesascode_cr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2025 The Tekton Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: operator.tekton.dev/v1alpha1
kind: OpenShiftPipelinesAsCode
metadata:
name: pipelines-as-code
spec:
targetNamespace: tekton-pipelines
1 change: 1 addition & 0 deletions config/kubernetes/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ resources:
- ../../webhooks/
- 300-operator_v1alpha1_dashboard_crd.yaml
- operator_service.yaml
- pipelinesascode.yaml
2 changes: 1 addition & 1 deletion config/kubernetes/base/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
image: ko://github.com/tektoncd/operator/cmd/kubernetes/operator
args:
- "-controllers"
- "tektonconfig,tektonpipeline,tektontrigger,tektonhub,tektonchain,tektonresult,tektondashboard,manualapprovalgate,tektonpruner,tektonscheduler,tektonmulticlusterproxyaae"
- "tektonconfig,tektonpipeline,tektontrigger,tektonhub,tektonchain,tektonresult,tektondashboard,manualapprovalgate,tektonpruner,tektonscheduler,tektonmulticlusterproxyaae,openshiftpipelinesascode"
- "-unique-process-name"
- "tekton-operator-lifecycle"
imagePullPolicy: IfNotPresent
Expand Down
32 changes: 32 additions & 0 deletions config/kubernetes/base/pipelinesascode.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: tekton-pac-controller-role
rules:
- apiGroups:
- pipelinesascode.tekton.dev
resources:
- repositories
- webhooks
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- deletecollection
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tekton-pac-controller-role-binding
subjects:
- kind: ServiceAccount
name: tekton-operator
namespace: tekton-operator
roleRef:
kind: ClusterRole
name: tekton-pac-controller-role
apiGroup: rbac.authorization.k8s.io
2 changes: 0 additions & 2 deletions config/openshift/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ patchesStrategicMerge:
resources:
- ../../base/
- ../../webhooks
- 300-operator_v1alpha1_addon_crd.yaml
- 300-operator_v1alpha1_openshiftpipelinesascode_crd.yaml
- operator_service.yaml
- operator_servicemonitor.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
Expand Down
9 changes: 5 additions & 4 deletions docs/TektonConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Other than the above components depending on the platform operator also provides
- [TektonResult](./TektonResult.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.

- [TektonAddon](./TektonAddon.md)
- [OpenShiftPipelinesAsCode](./OpenShiftPipelinesAsCode.md)
Expand Down Expand Up @@ -130,7 +131,7 @@ spec:
trigger:
disabled: false
platforms:
openshift:
openshift: # or `kubernetes:` on Kubernetes clusters
pipelinesAsCode:
additionalPACControllers:
<controllerName>:
Expand Down Expand Up @@ -576,7 +577,7 @@ In the deployment the environment name will be converted as follows,

### OpenShiftPipelinesAsCode

The PipelinesAsCode section allows you to customize the Pipelines as Code features. When you change the TektonConfig CR, the Operator automatically applies the settings to custom resources and configmaps in your installation.
The PipelinesAsCode section allows you to customize the Pipelines as Code features on both Kubernetes and OpenShift. When you change the TektonConfig CR, the Operator automatically applies the settings to custom resources and configmaps in your installation. On Kubernetes, configure `spec.platforms.kubernetes.pipelinesAsCode` (the managed CR remains `OpenShiftPipelinesAsCode` for API compatibility).

Some of the fields have default values, so operator will add them if the user hasn't passed in CR. Other fields which
don't have default values unless the user specifies them. User can find those [here](https://pipelinesascode.com/docs/install/settings/#pipelines-as-code-configuration-settings).
Expand All @@ -585,7 +586,7 @@ Example:

```yaml
platforms:
openshift:
openshift: # or `kubernetes:`
pipelinesAsCode:
additionalPACControllers:
controllername:
Expand Down Expand Up @@ -680,7 +681,7 @@ pipelinesascode.tekton.dev/task: "artifact://buildah"

For more details, see the [Pipelines-as-Code Remote Hub Catalogs documentation](https://pipelinesascode.com/docs/install/settings/#remote-hub-catalogs).

**NOTE**: OpenShiftPipelinesAsCode is currently available for the OpenShift Platform only.
**NOTE**: On Kubernetes clusters, use `spec.platforms.kubernetes.pipelinesAsCode`. The custom resource kind remains `OpenShiftPipelinesAsCode`.

### Event based pruner

Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ require (
replace (
github.com/alibabacloud-go/cr-20160607 => github.com/vdemeester/cr-20160607 v1.0.1
github.com/go-jose/go-jose/v4 => github.com/go-jose/go-jose/v4 v4.1.4
github.com/openshift-pipelines/pipelines-as-code => github.com/tektoncd/pipelines-as-code v0.43.0
k8s.io/api => k8s.io/api v0.32.4
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.32.9
k8s.io/apimachinery => k8s.io/apimachinery v0.32.4
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2409,8 +2409,6 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040=
github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M=
github.com/openshift-pipelines/pipelines-as-code v0.43.0 h1:xbwfViXC5H5Gjp/MCNDq4ugfQCE+eLiLpwq63zfRAm0=
github.com/openshift-pipelines/pipelines-as-code v0.43.0/go.mod h1:mUmrLuQtdzWXcj+EeVJZv+RjkOkWwNDEEldc03spTn8=
github.com/openshift/api v0.0.0-20240521185306-0314f31e7774 h1:SsoLnIil/D0FcjUbQ9Z8h95B7rxFvrso2X6OQjR8jPw=
github.com/openshift/api v0.0.0-20240521185306-0314f31e7774/go.mod h1:7Hm1kLJGxWT6eysOpD2zUztdn+w91eiERn6KtI5o9aw=
github.com/openshift/apiserver-library-go v0.0.0-20230816171015-6bfafa975bfb h1:UMgJny13BBcHpY+JQ9Eg1Dm9+J7nWO3eqPvV1Zpd49A=
Expand Down Expand Up @@ -2649,6 +2647,8 @@ github.com/tchap/go-patricia/v2 v2.3.3 h1:xfNEsODumaEcCcY3gI0hYPZ/PcpVv5ju6RMAhg
github.com/tchap/go-patricia/v2 v2.3.3/go.mod h1:VZRHKAb53DLaG+nA9EaYYiaEx6YztwDlLElMsnSHD4k=
github.com/tektoncd/pipeline v1.9.2 h1:uKEt6CGLmkeKLdKIZnel0gn8lfQ1P7+398yystdBuHU=
github.com/tektoncd/pipeline v1.9.2/go.mod h1:PTlIZ4Mhr8HZDx404O7spJtafiynetTMedCsXStjtHk=
github.com/tektoncd/pipelines-as-code v0.43.0 h1:GVlN4S8wqjl/YJf8TO1CikznxwK3qBEaQhjnrRCe0VY=
github.com/tektoncd/pipelines-as-code v0.43.0/go.mod h1:mUmrLuQtdzWXcj+EeVJZv+RjkOkWwNDEEldc03spTn8=
github.com/tektoncd/plumbing v0.0.0-20250805154627-25448098dea2 h1:v4UPEbe6MEto5i4ELtiXWBxUAUIAWL5U1DznfPhi4WE=
github.com/tektoncd/plumbing v0.0.0-20250805154627-25448098dea2/go.mod h1:BC6F3DlZc+wpUT9YcwG9MoSfb4tUiH2olB9xYoIsB4I=
github.com/tektoncd/pruner v0.3.5 h1:eQTgnQ56Par9d/6BICsXfTkR0Ybx8c/0QLZeNoJnaYQ=
Expand Down
20 changes: 14 additions & 6 deletions hack/fetch-releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,15 @@ release_yaml_pac() {
comp_dir=${ko_data}/tekton-addon/pipelines-as-code
dirPath=${comp_dir}/${version}

local pac_release_yaml=release.yaml
if [[ ${TARGET} != "openshift" ]]; then
pac_release_yaml=release.k8s.yaml
fi

if [[ ${version} == "stable" || ${version} == "nightly" ]]; then
url="https://raw.githubusercontent.com/openshift-pipelines/pipelines-as-code/${version}/release.yaml"
url="https://raw.githubusercontent.com/tektoncd/pipelines-as-code/${version}/${pac_release_yaml}"
else
url="https://raw.githubusercontent.com/openshift-pipelines/pipelines-as-code/release-${version}/release.yaml"
url="https://raw.githubusercontent.com/tektoncd/pipelines-as-code/release-${version}/${pac_release_yaml}"
fi

dest=${dirPath}/${fileName}.yaml
Expand Down Expand Up @@ -247,7 +252,7 @@ release_yaml_pac() {
do
echo "fetching PipelineRun template for runtime: $run"

source="https://raw.githubusercontent.com/openshift-pipelines/pipelines-as-code/${version}/pkg/cmd/tknpac/generate/templates/${run}.yaml"
source="https://raw.githubusercontent.com/tektoncd/pipelines-as-code/${version}/pkg/cmd/tknpac/generate/templates/${run}.yaml"
dest_dir="${ko_data}/tekton-addon/pipelines-as-code-templates"
mkdir -p ${dest_dir} || true
destination="${dest_dir}/${run}.yaml"
Expand Down Expand Up @@ -411,9 +416,12 @@ main() {
# get release YAML for Dashboard
release_yaml dashboard release-full 00-dashboard ${d_version}
release_yaml dashboard release 00-dashboard ${d_version}
else
pac_version=$(go run ./cmd/tool component-version ${CONFIG} pipelines-as-code)
release_yaml_pac pipelinesascode release ${pac_version}
fi

pac_version=$(go run ./cmd/tool component-version ${CONFIG} pipelines-as-code)
release_yaml_pac pipelinesascode release ${pac_version}

if [[ ${TARGET} == "openshift" ]]; then
fetch_openshift_addon_tasks
fi

Expand Down
23 changes: 23 additions & 0 deletions pkg/apis/operator/v1alpha1/kubernetes_platform.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
Copyright 2025 The Tekton Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

type Kubernetes struct {
// PipelinesAsCode allows configuring PipelinesAsCode configurations
// +optional
PipelinesAsCode *PipelinesAsCode `json:"pipelinesAsCode,omitempty"`
}
9 changes: 0 additions & 9 deletions pkg/apis/operator/v1alpha1/openshift_platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ type OpenShift struct {
SCC *SCC `json:"scc,omitempty"`
}

type PipelinesAsCode struct {
// Enable or disable pipelines as code by changing this bool
// +optional
Enable *bool `json:"enable,omitempty"`
// PACSettings allows user to configure PAC configurations
// +optional
PACSettings `json:",inline"`
}

type SCC struct {
// Default contains the default SCC that will be attached to the service
// account used for workloads (`pipeline` SA by default) and defined in
Expand Down
28 changes: 28 additions & 0 deletions pkg/apis/operator/v1alpha1/pipelinesascode.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
Copyright 2025 The Tekton Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

// PipelinesAsCode holds common settings for both Kubernetes and OpenShift.
// +k8s:openapi-gen=true
type PipelinesAsCode struct {
// Enable or disable pipelines as code by changing this bool
// +optional
Enable *bool `json:"enable,omitempty"`
// PACSettings allows user to configure PAC configurations
// +optional
PACSettings `json:",inline"`
}
Loading
Loading