Repository: tektoncd/operator
Pull request #404 (2021-09-09 07:01:50)

Fixes deployment on OpenShift
 
Moves TektonConfig ExtendedController to a separate pkg

TektonConfig's ExtendedController is used in both platforms k8s and
OpenShift and was in the k8s pkg. K8s controller use Dashboard
informer but OpenShift's doesn't need it. As we import the Dashboard
Informer pkg in k8s it has an init func which get executed and looks
for Dashboard CRD. This was happening with OpenShift where we don't
install Dashboard CRD now. so to avoid dashboard informer getting
initialize for OpenShift moving ExtendedController to a separate pkg.

-------------------------------------------------------------------------------------

 Enable TektonAddon Defaulting & Validation in Webhook

This fixes the failure of TektonAddon on OpenShift because of the
params not getting added to cr. this enables the defaulting
and validation in TektonConfig.

This also adds for k8s platform but it won't have any effect of the
installation of addon on k8s as it is not controller in not added
for k8s. This in plan to enable in upcoming days.

----------------------------------------------------------------------

 [OpenShift] Fixes Operator webhook

Earlier for Openshift, the specific files were not getting merged in
base due to which webhook was looking at tekton-operator ns instead
of openshift-operators, this fixes it.

And also updates the service account and rbac for webhook.

Signed-off-by: Shivam Mukhade <smukhade@redhat.com>

<!-- Describe your changes here- ideally you can get that description straight from
your descriptive commit message(s)! -->

# Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

- [x] Includes [tests](https://github.com/tektoncd/community/blob/master/standards.md#principles) (if functionality changed/added)
- [ ] Includes [docs](https://github.com/tektoncd/community/blob/master/standards.md#principles) (if user facing)
- [x] Commit messages follow [commit message best practices](https://github.com/tektoncd/community/blob/master/standards.md#commit-messages)

_See [the contribution guide](https://github.com/tektoncd/operator/blob/master/CONTRIBUTING.md) for more details._

# Release Notes

<!--
Describe any user facing changes here, or delete this block.

Examples of user facing changes:
- API changes
- Bug fixes
- Any changes in behavior
- Changes requiring upgrade notices or deprecation warnings

For pull requests with a release note:

```release-note
Your release note here
```

For pull requests that require additional action from users switching to the new release, include the string "action required" (case insensitive) in the release note:

```release-note
action required: your release note here
```

For pull requests that don't need to be mentioned at release time, use the `/release-note-none` Prow command to add the `release-note-none` label to the PR. You can also write the string "NONE" as a release note in your PR description:

```release-note
NONE
```
-->


tekton-robot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by:
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **nikhil-thomas**
You can assign the PR to them by writing `/assign @nikhil-thomas` in a comment when ready.

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=tektoncd%2Foperator).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/tektoncd/operator/blob/main/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["nikhil-thomas"]} -->
tekton-robot: The following is the coverage report on the affected files.
Say `/test pull-tekton-operator-go-coverage` to re-run this coverage report

File | Old Coverage | New Coverage | Delta
---- |:------------:|:------------:|:-----:
[pkg/reconciler/common-reconciler/tektonconfig/pipeline/pipeline.go](https://storage.cloud.google.com/tekton-prow/pr-logs/pull/tektoncd_operator/404/pull-tekton-operator-go-coverage/1435861003274293250/artifacts/line-cov.html#file1) | Do not exist | 56.5% | 
[pkg/reconciler/common-reconciler/tektonconfig/trigger/trigger.go](https://storage.cloud.google.com/tekton-prow/pr-logs/pull/tektoncd_operator/404/pull-tekton-operator-go-coverage/1435861003274293250/artifacts/line-cov.html#file2) | Do not exist | 72.1% | 

tekton-robot: @sm43: The following test **failed**, say `/retest` to rerun them all:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-tekton-operator-build-tests | 32931f2e573f658e694819deaeea49ed7d549c67 | [link](https://tekton-releases.appspot.com/build/tekton-prow/pr-logs/pull/tektoncd_operator/404/pull-tekton-operator-build-tests/1435861003274293248/) | `/test pull-tekton-operator-build-tests`

[Full PR test history](https://tekton-releases.appspot.com/pr/tektoncd_operator/404). [Your PR dashboard](https://prow.tekton.dev/pr/sm43).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
tekton-robot: @sm43: The following test **failed**, say `/retest` to rerun them all:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-tekton-operator-build-tests | 32931f2e573f658e694819deaeea49ed7d549c67 | [link](https://tekton-releases.appspot.com/build/tekton-prow/pr-logs/pull/tektoncd_operator/404/pull-tekton-operator-build-tests/1435861003274293248/) | `/test pull-tekton-operator-build-tests`

[Full PR test history](https://tekton-releases.appspot.com/pr/tektoncd_operator/404). [Your PR dashboard](https://prow.tekton.dev/pr/sm43).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
tekton-robot: The following is the coverage report on the affected files.
Say `/test pull-tekton-operator-go-coverage` to re-run this coverage report

File | Old Coverage | New Coverage | Delta
---- |:------------:|:------------:|:-----:
[pkg/reconciler/common-reconciler/tektonconfig/pipeline/pipeline.go](https://storage.cloud.google.com/tekton-prow/pr-logs/pull/tektoncd_operator/404/pull-tekton-operator-go-coverage/1435865784327868418/artifacts/line-cov.html#file1) | Do not exist | 56.5% | 
[pkg/reconciler/common-reconciler/tektonconfig/trigger/trigger.go](https://storage.cloud.google.com/tekton-prow/pr-logs/pull/tektoncd_operator/404/pull-tekton-operator-go-coverage/1435865784327868418/artifacts/line-cov.html#file2) | Do not exist | 72.1% | 

sm43: > Not a fan of the package sweat_smile `pkg/reconciler/common-reconciler/…` there is `common` and a repetition there. What `pkg/reconciler/shared/…` instead ? (it's the "shared" code for all platform more or less).

@vdemeester 
yep shared is better. was not able to think of any 😅 will update. Thnx

> 
> Not to take in this PR, but `NewExtendedController` might be better named `NewExtensibleController`, shouldn't it ? thinking

yeah `NewExtensibleController` make sense 


tekton-robot: The following is the coverage report on the affected files.
Say `/test pull-tekton-operator-go-coverage` to re-run this coverage report

File | Old Coverage | New Coverage | Delta
---- |:------------:|:------------:|:-----:
[pkg/reconciler/shared/tektonconfig/pipeline/pipeline.go](https://storage.cloud.google.com/tekton-prow/pr-logs/pull/tektoncd_operator/404/pull-tekton-operator-go-coverage/1435903910404427776/artifacts/line-cov.html#file3) | Do not exist | 56.5% | 
[pkg/reconciler/shared/tektonconfig/trigger/trigger.go](https://storage.cloud.google.com/tekton-prow/pr-logs/pull/tektoncd_operator/404/pull-tekton-operator-go-coverage/1435903910404427776/artifacts/line-cov.html#file4) | Do not exist | 72.1% | 

tekton-robot: The following is the coverage report on the affected files.
Say `/test pull-tekton-operator-go-coverage` to re-run this coverage report

File | Old Coverage | New Coverage | Delta
---- |:------------:|:------------:|:-----:
[pkg/reconciler/shared/tektonconfig/pipeline/pipeline.go](https://storage.cloud.google.com/tekton-prow/pr-logs/pull/tektoncd_operator/404/pull-tekton-operator-go-coverage/1435904664758390784/artifacts/line-cov.html#file3) | Do not exist | 56.5% | 
[pkg/reconciler/shared/tektonconfig/trigger/trigger.go](https://storage.cloud.google.com/tekton-prow/pr-logs/pull/tektoncd_operator/404/pull-tekton-operator-go-coverage/1435904664758390784/artifacts/line-cov.html#file4) | Do not exist | 72.1% | 

pradeepitm12: most of the review comments seem already addressed
/lgtm
tekton-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/tektoncd/operator/pull/404#pullrequestreview-750183403" title="Approved">vdemeester</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=tektoncd%2Foperator).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/tektoncd/operator/blob/main/OWNERS)~~ [vdemeester]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->

Patch:
diff --git a/config/openshift/kustomization.yaml b/config/openshift/kustomization.yaml
index 8fea882c8..5fabf53da 100644
--- a/config/openshift/kustomization.yaml
+++ b/config/openshift/kustomization.yaml
@@ -38,6 +38,9 @@ patches:
     kind: ClusterRoleBinding
     name: tekton-operator
 
+patchesStrategicMerge:
+- 500-webhooks.yaml
+
 resources:
 - ../base/
 - 300-operator_v1alpha1_addon_crd.yaml
diff --git a/config/openshift/role.yaml b/config/openshift/role.yaml
index c54c18637..5c47ae680 100644
--- a/config/openshift/role.yaml
+++ b/config/openshift/role.yaml
@@ -341,3 +341,10 @@ rules:
   - list
   - update
   - watch
+  # finalizers are needed for the owner reference of the webhook
+- apiGroups:
+  - ""
+  resources:
+  - "namespaces/finalizers"
+  verbs:
+  - "update"
\ No newline at end of file
diff --git a/config/openshift/webhook.yaml b/config/openshift/webhook.yaml
index eb89bab68..f4b7a16b5 100644
--- a/config/openshift/webhook.yaml
+++ b/config/openshift/webhook.yaml
@@ -30,7 +30,7 @@ spec:
         name: tekton-operator-webhook
         app: tekton-operator
     spec:
-      serviceAccountName: tekton-operator
+      serviceAccountName: openshift-pipelines-operator
       containers:
       - name: tekton-operator-webhook
         image: ko://github.com/tektoncd/operator/cmd/openshift/webhook
diff --git a/pkg/apis/operator/v1alpha1/tektonconfig_defaults.go b/pkg/apis/operator/v1alpha1/tektonconfig_defaults.go
index bab02b76e..55ba1ec11 100644
--- a/pkg/apis/operator/v1alpha1/tektonconfig_defaults.go
+++ b/pkg/apis/operator/v1alpha1/tektonconfig_defaults.go
@@ -26,4 +26,6 @@ func (tc *TektonConfig) SetDefaults(ctx context.Context) {
 	}
 
 	tc.Spec.Pipeline.PipelineProperties.setDefaults()
+
+	setAddonDefaults(&tc.Spec.Addon.Params)
 }
diff --git a/pkg/reconciler/kubernetes/tektonconfig/controller.go b/pkg/reconciler/kubernetes/tektonconfig/controller.go
index 393eeab8f..88acfc6c8 100644
--- a/pkg/reconciler/kubernetes/tektonconfig/controller.go
+++ b/pkg/reconciler/kubernetes/tektonconfig/controller.go
@@ -18,94 +18,24 @@ package tektonconfig
 
 import (
 	"context"
-	"os"
 
-	"github.com/go-logr/zapr"
-	mfc "github.com/manifestival/client-go-client"
-	mf "github.com/manifestival/manifestival"
-	"go.uber.org/zap"
 	"k8s.io/client-go/tools/cache"
 
 	"github.com/tektoncd/operator/pkg/apis/operator/v1alpha1"
-	operatorclient "github.com/tektoncd/operator/pkg/client/injection/client"
-	tektonConfiginformer "github.com/tektoncd/operator/pkg/client/injection/informers/operator/v1alpha1/tektonconfig"
 	tektonDashboardinformer "github.com/tektoncd/operator/pkg/client/injection/informers/operator/v1alpha1/tektondashboard"
-	tektonPipelineinformer "github.com/tektoncd/operator/pkg/client/injection/informers/operator/v1alpha1/tektonpipeline"
-	tektonTriggerinformer "github.com/tektoncd/operator/pkg/client/injection/informers/operator/v1alpha1/tektontrigger"
-	tektonConfigreconciler "github.com/tektoncd/operator/pkg/client/injection/reconciler/operator/v1alpha1/tektonconfig"
-	"github.com/tektoncd/operator/pkg/reconciler/common"
-	kubeclient "knative.dev/pkg/client/injection/kube/client"
-	deploymentinformer "knative.dev/pkg/client/injection/kube/informers/apps/v1/deployment"
+	"github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig"
 	"knative.dev/pkg/configmap"
 	"knative.dev/pkg/controller"
-	"knative.dev/pkg/injection"
-	"knative.dev/pkg/logging"
 )
 
 // NewController initializes the controller and is called by the generated code
 // Registers eventhandlers to enqueue events
 func NewController(ctx context.Context, cmw configmap.Watcher) *controller.Impl {
 
-	ctrl := NewExtendedController(KubernetesExtension)(ctx, cmw)
+	ctrl := tektonconfig.NewExtensibleController(KubernetesExtension)(ctx, cmw)
 	tektonDashboardinformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{
 		FilterFunc: controller.FilterControllerGVK(v1alpha1.SchemeGroupVersion.WithKind("TektonConfig")),
 		Handler:    controller.HandleAll(ctrl.EnqueueControllerOf),
 	})
 	return ctrl
 }
-
-// NewExtendedController returns a controller extended to a specific platform
-func NewExtendedController(generator common.ExtensionGenerator) injection.ControllerConstructor {
-	return func(ctx context.Context, cmw configmap.Watcher) *controller.Impl {
-		tektonConfigInformer := tektonConfiginformer.Get(ctx)
-		tektonPipelineInformer := tektonPipelineinformer.Get(ctx)
-		tektonTriggerInformer := tektonTriggerinformer.Get(ctx)
-		deploymentInformer := deploymentinformer.Get(ctx)
-		kubeClient := kubeclient.Get(ctx)
-		logger := logging.FromContext(ctx)
-
-		mfclient, err := mfc.NewClient(injection.GetConfig(ctx))
-		if err != nil {
-			logger.Fatalw("Error creating client from injected config", zap.Error(err))
-		}
-		mflogger := zapr.NewLogger(logger.Named("manifestival").Desugar())
-		manifest, err := mf.ManifestFrom(mf.Slice{}, mf.UseClient(mfclient), mf.UseLogger(mflogger))
-		if err != nil {
-			logger.Fatalw("Error creating initial manifest", zap.Error(err))
-		}
-
-		c := &Reconciler{
-			kubeClientSet:     kubeClient,
-			operatorClientSet: operatorclient.Get(ctx),
-			extension:         generator(ctx),
-			manifest:          manifest,
-		}
-		impl := tektonConfigreconciler.NewImpl(ctx, c)
-
-		logger.Info("Setting up event handlers")
-
-		tektonConfigInformer.Informer().AddEventHandler(controller.HandleAll(impl.Enqueue))
-
-		tektonPipelineInformer.Informer().AddEventHandler(cache.FilteringResourceEventHandler{
-			FilterFunc: controller.FilterControllerGVK(v1alpha1.SchemeGroupVersion.WithKind("TektonConfig")),
-			Handler:    controller.HandleAll(impl.EnqueueControllerOf),
-		})
-
-		tektonTriggerInformer.Informer().AddEventHandler(cache.FilteringResourceEventHandler{
-			FilterFunc: controller.FilterControllerGVK(v1alpha1.SchemeGroupVersion.WithKind("TektonConfig")),
-			Handler:    controller.HandleAll(impl.EnqueueControllerOf),
-		})
-
-		deploymentInformer.Informer().AddEventHandler(cache.FilteringResourceEventHandler{
-			FilterFunc: controller.FilterControllerGVK(v1alpha1.SchemeGroupVersion.WithKind("TektonConfig")),
-			Handler:    controller.HandleAll(impl.EnqueueControllerOf),
-		})
-
-		if os.Getenv("AUTOINSTALL_COMPONENTS") == "true" {
-			// try to ensure that there is an instance of tektonConfig
-			newTektonConfig(operatorclient.Get(ctx), kubeclient.Get(ctx), manifest).ensureInstance(ctx)
-		}
-
-		return impl
-	}
-}
diff --git a/pkg/reconciler/openshift/tektonconfig/controller.go b/pkg/reconciler/openshift/tektonconfig/controller.go
index 1b7e5ad96..c667921d9 100644
--- a/pkg/reconciler/openshift/tektonconfig/controller.go
+++ b/pkg/reconciler/openshift/tektonconfig/controller.go
@@ -22,7 +22,7 @@ import (
 	"github.com/tektoncd/operator/pkg/apis/operator/v1alpha1"
 	tektonAddoninformer "github.com/tektoncd/operator/pkg/client/injection/informers/operator/v1alpha1/tektonaddon"
 	"github.com/tektoncd/operator/pkg/reconciler/common"
-	k8s_ctrl "github.com/tektoncd/operator/pkg/reconciler/kubernetes/tektonconfig"
+	"github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig"
 	"k8s.io/apimachinery/pkg/types"
 	"k8s.io/client-go/tools/cache"
 	namespaceinformer "knative.dev/pkg/client/injection/kube/informers/core/v1/namespace"
@@ -34,7 +34,7 @@ import (
 // NewController initializes the controller and is called by the generated code
 // Registers eventhandlers to enqueue events
 func NewController(ctx context.Context, cmw configmap.Watcher) *controller.Impl {
-	ctrl := k8s_ctrl.NewExtendedController(OpenShiftExtension)(ctx, cmw)
+	ctrl := tektonconfig.NewExtensibleController(OpenShiftExtension)(ctx, cmw)
 	namespaceInformer := namespaceinformer.Get(ctx)
 	namespaceInformer.Informer().AddEventHandler(controller.HandleAll(enqueueCustomName(ctrl, common.ConfigResourceName)))
 
diff --git a/pkg/reconciler/shared/tektonconfig/controller.go b/pkg/reconciler/shared/tektonconfig/controller.go
new file mode 100644
index 000000000..4aed1e80e
--- /dev/null
+++ b/pkg/reconciler/shared/tektonconfig/controller.go
@@ -0,0 +1,97 @@
+/*
+Copyright 2021 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 tektonconfig
+
+import (
+	"context"
+	"os"
+
+	"github.com/go-logr/zapr"
+	mfc "github.com/manifestival/client-go-client"
+	mf "github.com/manifestival/manifestival"
+	"github.com/tektoncd/operator/pkg/apis/operator/v1alpha1"
+	operatorclient "github.com/tektoncd/operator/pkg/client/injection/client"
+	tektonConfiginformer "github.com/tektoncd/operator/pkg/client/injection/informers/operator/v1alpha1/tektonconfig"
+	tektonPipelineinformer "github.com/tektoncd/operator/pkg/client/injection/informers/operator/v1alpha1/tektonpipeline"
+	tektonTriggerinformer "github.com/tektoncd/operator/pkg/client/injection/informers/operator/v1alpha1/tektontrigger"
+	tektonConfigreconciler "github.com/tektoncd/operator/pkg/client/injection/reconciler/operator/v1alpha1/tektonconfig"
+	"github.com/tektoncd/operator/pkg/reconciler/common"
+	"go.uber.org/zap"
+	"k8s.io/client-go/tools/cache"
+	kubeclient "knative.dev/pkg/client/injection/kube/client"
+	deploymentinformer "knative.dev/pkg/client/injection/kube/informers/apps/v1/deployment"
+	"knative.dev/pkg/configmap"
+	"knative.dev/pkg/controller"
+	"knative.dev/pkg/injection"
+	"knative.dev/pkg/logging"
+)
+
+// NewExtensibleController returns a controller extended to a specific platform
+func NewExtensibleController(generator common.ExtensionGenerator) injection.ControllerConstructor {
+	return func(ctx context.Context, cmw configmap.Watcher) *controller.Impl {
+		tektonConfigInformer := tektonConfiginformer.Get(ctx)
+		tektonPipelineInformer := tektonPipelineinformer.Get(ctx)
+		tektonTriggerInformer := tektonTriggerinformer.Get(ctx)
+		deploymentInformer := deploymentinformer.Get(ctx)
+		kubeClient := kubeclient.Get(ctx)
+		logger := logging.FromContext(ctx)
+
+		mfclient, err := mfc.NewClient(injection.GetConfig(ctx))
+		if err != nil {
+			logger.Fatalw("Error creating client from injected config", zap.Error(err))
+		}
+		mflogger := zapr.NewLogger(logger.Named("manifestival").Desugar())
+		manifest, err := mf.ManifestFrom(mf.Slice{}, mf.UseClient(mfclient), mf.UseLogger(mflogger))
+		if err != nil {
+			logger.Fatalw("Error creating initial manifest", zap.Error(err))
+		}
+
+		c := &Reconciler{
+			kubeClientSet:     kubeClient,
+			operatorClientSet: operatorclient.Get(ctx),
+			extension:         generator(ctx),
+			manifest:          manifest,
+		}
+		impl := tektonConfigreconciler.NewImpl(ctx, c)
+
+		logger.Info("Setting up event handlers")
+
+		tektonConfigInformer.Informer().AddEventHandler(controller.HandleAll(impl.Enqueue))
+
+		tektonPipelineInformer.Informer().AddEventHandler(cache.FilteringResourceEventHandler{
+			FilterFunc: controller.FilterControllerGVK(v1alpha1.SchemeGroupVersion.WithKind("TektonConfig")),
+			Handler:    controller.HandleAll(impl.EnqueueControllerOf),
+		})
+
+		tektonTriggerInformer.Informer().AddEventHandler(cache.FilteringResourceEventHandler{
+			FilterFunc: controller.FilterControllerGVK(v1alpha1.SchemeGroupVersion.WithKind("TektonConfig")),
+			Handler:    controller.HandleAll(impl.EnqueueControllerOf),
+		})
+
+		deploymentInformer.Informer().AddEventHandler(cache.FilteringResourceEventHandler{
+			FilterFunc: controller.FilterControllerGVK(v1alpha1.SchemeGroupVersion.WithKind("TektonConfig")),
+			Handler:    controller.HandleAll(impl.EnqueueControllerOf),
+		})
+
+		if os.Getenv("AUTOINSTALL_COMPONENTS") == "true" {
+			// try to ensure that there is an instance of tektonConfig
+			newTektonConfig(operatorclient.Get(ctx), kubeclient.Get(ctx), manifest).ensureInstance(ctx)
+		}
+
+		return impl
+	}
+}
diff --git a/pkg/reconciler/kubernetes/tektonconfig/instance.go b/pkg/reconciler/shared/tektonconfig/instance.go
similarity index 100%
rename from pkg/reconciler/kubernetes/tektonconfig/instance.go
rename to pkg/reconciler/shared/tektonconfig/instance.go
diff --git a/pkg/reconciler/kubernetes/tektonconfig/pipeline/pipeline.go b/pkg/reconciler/shared/tektonconfig/pipeline/pipeline.go
similarity index 99%
rename from pkg/reconciler/kubernetes/tektonconfig/pipeline/pipeline.go
rename to pkg/reconciler/shared/tektonconfig/pipeline/pipeline.go
index 8b4ebeccd..ef8fc0cc4 100644
--- a/pkg/reconciler/kubernetes/tektonconfig/pipeline/pipeline.go
+++ b/pkg/reconciler/shared/tektonconfig/pipeline/pipeline.go
@@ -1,5 +1,5 @@
 /*
-Copyright 2020 The Tekton Authors
+Copyright 2021 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.
diff --git a/pkg/reconciler/kubernetes/tektonconfig/tektonconfig.go b/pkg/reconciler/shared/tektonconfig/tektonconfig.go
similarity index 93%
rename from pkg/reconciler/kubernetes/tektonconfig/tektonconfig.go
rename to pkg/reconciler/shared/tektonconfig/tektonconfig.go
index 92dde629b..fff622391 100644
--- a/pkg/reconciler/kubernetes/tektonconfig/tektonconfig.go
+++ b/pkg/reconciler/shared/tektonconfig/tektonconfig.go
@@ -1,5 +1,5 @@
 /*
-Copyright 2020 The Tekton Authors
+Copyright 2021 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.
@@ -29,9 +29,8 @@ import (
 	clientset "github.com/tektoncd/operator/pkg/client/clientset/versioned"
 	tektonConfigreconciler "github.com/tektoncd/operator/pkg/client/injection/reconciler/operator/v1alpha1/tektonconfig"
 	"github.com/tektoncd/operator/pkg/reconciler/common"
-	"github.com/tektoncd/operator/pkg/reconciler/kubernetes/tektonconfig/pipeline"
-	"github.com/tektoncd/operator/pkg/reconciler/kubernetes/tektonconfig/trigger"
-	tt "github.com/tektoncd/operator/pkg/reconciler/kubernetes/tektonconfig/trigger"
+	"github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/pipeline"
+	"github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/trigger"
 	"knative.dev/pkg/logging"
 	pkgreconciler "knative.dev/pkg/reconciler"
 )
@@ -121,7 +120,7 @@ func (r *Reconciler) ReconcileKind(ctx context.Context, tc *v1alpha1.TektonConfi
 
 	var stages common.Stages
 	if tc.Spec.Profile == common.ProfileLite {
-		err := tt.TektonTriggerCRDelete(r.operatorClientSet.OperatorV1alpha1().TektonTriggers(), common.TriggerResourceName)
+		err := trigger.TektonTriggerCRDelete(r.operatorClientSet.OperatorV1alpha1().TektonTriggers(), common.TriggerResourceName)
 		if err != nil {
 			if errors.IsNotFound(err) {
 				return nil
diff --git a/pkg/reconciler/kubernetes/tektonconfig/trigger/trigger.go b/pkg/reconciler/shared/tektonconfig/trigger/trigger.go
similarity index 99%
rename from pkg/reconciler/kubernetes/tektonconfig/trigger/trigger.go
rename to pkg/reconciler/shared/tektonconfig/trigger/trigger.go
index e606de3d0..dbf4fb3fd 100644
--- a/pkg/reconciler/kubernetes/tektonconfig/trigger/trigger.go
+++ b/pkg/reconciler/shared/tektonconfig/trigger/trigger.go
@@ -1,5 +1,5 @@
 /*
-Copyright 2020 The Tekton Authors
+Copyright 2021 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.
diff --git a/third_party/github.com/hashicorp/golang-lru/simplelru/lru_interface.go b/third_party/github.com/hashicorp/golang-lru/simplelru/lru_interface.go
index 92d70934d..a0b97e3f7 100644
--- a/third_party/github.com/hashicorp/golang-lru/simplelru/lru_interface.go
+++ b/third_party/github.com/hashicorp/golang-lru/simplelru/lru_interface.go
@@ -34,6 +34,6 @@ type LRUCache interface {
 	// Clears all cache entries.
 	Purge()
 
-  // Resizes cache, returning number evicted
-  Resize(int) int
+	// Resizes cache, returning number evicted
+	Resize(int) int
 }


Test patch:
diff --git a/pkg/apis/operator/v1alpha1/tektonconfig_default_test.go b/pkg/apis/operator/v1alpha1/tektonconfig_default_test.go
index 3035f82a4..7a6ff8498 100644
--- a/pkg/apis/operator/v1alpha1/tektonconfig_default_test.go
+++ b/pkg/apis/operator/v1alpha1/tektonconfig_default_test.go
@@ -71,3 +71,23 @@ func Test_SetDefaults_Pipeline_Properties(t *testing.T) {
 		t.Error("Setting default failed for TektonConfig (spec.pipeline.pipelineProperties)")
 	}
 }
+
+func Test_SetDefaults_Addon_Params(t *testing.T) {
+
+	tc := &TektonConfig{
+		ObjectMeta: metav1.ObjectMeta{
+			Name:      "name",
+			Namespace: "namespace",
+		},
+		Spec: TektonConfigSpec{
+			CommonSpec: CommonSpec{
+				TargetNamespace: "namespace",
+			},
+		},
+	}
+
+	tc.SetDefaults(context.TODO())
+	if len(tc.Spec.Addon.Params) != 2 {
+		t.Error("Setting default failed for TektonConfig (spec.addon.params)")
+	}
+}
diff --git a/pkg/reconciler/kubernetes/tektonconfig/extension/dashboard_test.go b/pkg/reconciler/kubernetes/tektonconfig/extension/dashboard_test.go
index 548466ff2..d346b6ea6 100644
--- a/pkg/reconciler/kubernetes/tektonconfig/extension/dashboard_test.go
+++ b/pkg/reconciler/kubernetes/tektonconfig/extension/dashboard_test.go
@@ -22,7 +22,7 @@ import (
 	"github.com/tektoncd/operator/pkg/client/injection/client/fake"
 	"github.com/tektoncd/operator/pkg/reconciler/common"
 	util "github.com/tektoncd/operator/pkg/reconciler/common/testing"
-	"github.com/tektoncd/operator/pkg/reconciler/kubernetes/tektonconfig/pipeline"
+	"github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/pipeline"
 	ts "knative.dev/pkg/reconciler/testing"
 )
 
diff --git a/pkg/reconciler/openshift/tektonconfig/extension/addon_test.go b/pkg/reconciler/openshift/tektonconfig/extension/addon_test.go
index 0cf9ba404..895aa43b9 100644
--- a/pkg/reconciler/openshift/tektonconfig/extension/addon_test.go
+++ b/pkg/reconciler/openshift/tektonconfig/extension/addon_test.go
@@ -22,7 +22,7 @@ import (
 	"github.com/tektoncd/operator/pkg/client/injection/client/fake"
 	"github.com/tektoncd/operator/pkg/reconciler/common"
 	util "github.com/tektoncd/operator/pkg/reconciler/common/testing"
-	"github.com/tektoncd/operator/pkg/reconciler/kubernetes/tektonconfig/pipeline"
+	"github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/pipeline"
 	ts "knative.dev/pkg/reconciler/testing"
 )
 
diff --git a/pkg/reconciler/kubernetes/tektonconfig/pipeline/pipeline_test.go b/pkg/reconciler/shared/tektonconfig/pipeline/pipeline_test.go
similarity index 97%
rename from pkg/reconciler/kubernetes/tektonconfig/pipeline/pipeline_test.go
rename to pkg/reconciler/shared/tektonconfig/pipeline/pipeline_test.go
index 06a77c07b..9c58a2598 100644
--- a/pkg/reconciler/kubernetes/tektonconfig/pipeline/pipeline_test.go
+++ b/pkg/reconciler/shared/tektonconfig/pipeline/pipeline_test.go
@@ -1,5 +1,5 @@
 /*
-Copyright 2020 The Tekton Authors
+Copyright 2021 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.
diff --git a/pkg/reconciler/kubernetes/tektonconfig/trigger/trigger_test.go b/pkg/reconciler/shared/tektonconfig/trigger/trigger_test.go
similarity index 93%
rename from pkg/reconciler/kubernetes/tektonconfig/trigger/trigger_test.go
rename to pkg/reconciler/shared/tektonconfig/trigger/trigger_test.go
index 4e2c40c22..64ef5f0e8 100644
--- a/pkg/reconciler/kubernetes/tektonconfig/trigger/trigger_test.go
+++ b/pkg/reconciler/shared/tektonconfig/trigger/trigger_test.go
@@ -1,5 +1,5 @@
 /*
-Copyright 2020 The Tekton Authors
+Copyright 2021 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.
@@ -22,7 +22,7 @@ import (
 	"github.com/tektoncd/operator/pkg/client/injection/client/fake"
 	"github.com/tektoncd/operator/pkg/reconciler/common"
 	util "github.com/tektoncd/operator/pkg/reconciler/common/testing"
-	"github.com/tektoncd/operator/pkg/reconciler/kubernetes/tektonconfig/pipeline"
+	"github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/pipeline"
 	ts "knative.dev/pkg/reconciler/testing"
 )