From 9aaa4dd115c826e91325264aeb837993ca01b3a9 Mon Sep 17 00:00:00 2001 From: Shivam Mukhade Date: Fri, 4 Mar 2022 11:18:57 +0530 Subject: [PATCH] [OpenShift] filter out namespace from pac manifest installerSet adds it's owner as namespace's owner so deleting tekton addon deletes target namespace too to skip it we filter out namespace Signed-off-by: Shivam Mukhade --- pkg/reconciler/openshift/tektonaddon/pipelinesascode.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/reconciler/openshift/tektonaddon/pipelinesascode.go b/pkg/reconciler/openshift/tektonaddon/pipelinesascode.go index 9489a50a9d..7f324a22f6 100644 --- a/pkg/reconciler/openshift/tektonaddon/pipelinesascode.go +++ b/pkg/reconciler/openshift/tektonaddon/pipelinesascode.go @@ -69,6 +69,11 @@ func (r *Reconciler) ensurePAC(ctx context.Context, ta *v1alpha1.TektonAddon) er return err } + // installerSet adds it's owner as namespace's owner + // so deleting tekton addon deletes target namespace too + // to skip it we filter out namespace + pacManifest = pacManifest.Filter(mf.Not(mf.ByKind("Namespace"))) + // Run transformers if err := r.addonTransform(ctx, &pacManifest, ta); err != nil { return err