From adc863c6ae0f573a6a29bb8437e51b9742f1699a Mon Sep 17 00:00:00 2001
From: Vineet Reddy Rajula <rajula.vineet.reddy@cern.ch>
Date: Tue, 27 Jul 2021 20:48:28 +0200
Subject: [PATCH] Remove ownerRef and add argocd ignore annotation

---
 chart/drupal-operations/templates/clear-cache.yaml        | 4 +++-
 chart/drupal-operations/templates/database-restore.yaml   | 4 +++-
 chart/drupal-operations/templates/drupalsite-backup.yaml  | 4 +++-
 chart/drupal-operations/templates/drupalsite-restore.yaml | 4 +++-
 examples/clear-cache-taskrun.yaml                         | 7 -------
 examples/database-restore-taskrun.yaml                    | 7 -------
 examples/drupalsite-backup-taskrun.yaml                   | 7 -------
 examples/drupalsite-restore-taskrun.yaml                  | 7 -------
 8 files changed, 12 insertions(+), 32 deletions(-)

diff --git a/chart/drupal-operations/templates/clear-cache.yaml b/chart/drupal-operations/templates/clear-cache.yaml
index 05ab110..32acc84 100644
--- a/chart/drupal-operations/templates/clear-cache.yaml
+++ b/chart/drupal-operations/templates/clear-cache.yaml
@@ -2,8 +2,10 @@ apiVersion: tekton.dev/v1beta1
 kind: ClusterTask
 metadata:
   name: clear-cache
-  annotations:
+  labels:
     app: drupal
+  annotations:
+    argocd.argoproj.io/compare-options: IgnoreExtraneous
 spec:
   params:
     - name: drupalSite
diff --git a/chart/drupal-operations/templates/database-restore.yaml b/chart/drupal-operations/templates/database-restore.yaml
index 3fdf7eb..3e9f4ed 100644
--- a/chart/drupal-operations/templates/database-restore.yaml
+++ b/chart/drupal-operations/templates/database-restore.yaml
@@ -2,8 +2,10 @@ apiVersion: tekton.dev/v1beta1
 kind: ClusterTask
 metadata:
   name: database-restore
-  annotations:
+  labels:
     app: drupal
+  annotations:
+    argocd.argoproj.io/compare-options: IgnoreExtraneous
 spec:
   params:
     - name: drupalSite
diff --git a/chart/drupal-operations/templates/drupalsite-backup.yaml b/chart/drupal-operations/templates/drupalsite-backup.yaml
index 27e9b41..964d32a 100644
--- a/chart/drupal-operations/templates/drupalsite-backup.yaml
+++ b/chart/drupal-operations/templates/drupalsite-backup.yaml
@@ -2,8 +2,10 @@ apiVersion: tekton.dev/v1beta1
 kind: ClusterTask
 metadata:
   name: drupalsite-backup
-  annotations:
+  labels:
     app: drupal
+  annotations:
+    argocd.argoproj.io/compare-options: IgnoreExtraneous
 spec:
   params:
     - name: drupalSite
diff --git a/chart/drupal-operations/templates/drupalsite-restore.yaml b/chart/drupal-operations/templates/drupalsite-restore.yaml
index e7d3de3..8fe740f 100644
--- a/chart/drupal-operations/templates/drupalsite-restore.yaml
+++ b/chart/drupal-operations/templates/drupalsite-restore.yaml
@@ -2,8 +2,10 @@ apiVersion: tekton.dev/v1beta1
 kind: ClusterTask
 metadata:
   name: drupalsite-restore
-  annotations:
+  labels:
     app: drupal
+  annotations:
+    argocd.argoproj.io/compare-options: IgnoreExtraneous
 spec:
   params:
     - name: drupalSite
diff --git a/examples/clear-cache-taskrun.yaml b/examples/clear-cache-taskrun.yaml
index b8c8e30..dd0257c 100644
--- a/examples/clear-cache-taskrun.yaml
+++ b/examples/clear-cache-taskrun.yaml
@@ -2,13 +2,6 @@ apiVersion: tekton.dev/v1beta1
 kind: TaskRun
 metadata:
   generateName: clear-cache-
-  ownerReferences:
-    - apiVersion: tekton.dev/v1beta1
-      blockOwnerDeletion: true
-      controller: true
-      kind: Pipeline
-      name: build-test
-      uid: my-uid
 spec:
   taskRef:
     name: clear-cache
diff --git a/examples/database-restore-taskrun.yaml b/examples/database-restore-taskrun.yaml
index 08af4ba..80accf0 100644
--- a/examples/database-restore-taskrun.yaml
+++ b/examples/database-restore-taskrun.yaml
@@ -2,13 +2,6 @@ apiVersion: tekton.dev/v1beta1
 kind: TaskRun
 metadata:
   generateName: database-restore-
-  ownerReferences:
-    - apiVersion: tekton.dev/v1beta1
-      blockOwnerDeletion: true
-      controller: true
-      kind: Pipeline
-      name: build-test
-      uid: my-uid
 spec:
   taskRef:
     name: database-restore
diff --git a/examples/drupalsite-backup-taskrun.yaml b/examples/drupalsite-backup-taskrun.yaml
index 904ee1f..67745ab 100644
--- a/examples/drupalsite-backup-taskrun.yaml
+++ b/examples/drupalsite-backup-taskrun.yaml
@@ -2,13 +2,6 @@ apiVersion: tekton.dev/v1beta1
 kind: TaskRun
 metadata:
   generateName: drupalsite-backup-
-  ownerReferences:
-    - apiVersion: tekton.dev/v1beta1
-      blockOwnerDeletion: true
-      controller: true
-      kind: ClusterTask
-      name: build-test
-      uid: my-uid
 spec:
   taskRef:
     name: drupalsite-backup
diff --git a/examples/drupalsite-restore-taskrun.yaml b/examples/drupalsite-restore-taskrun.yaml
index bafc026..a26a6ed 100644
--- a/examples/drupalsite-restore-taskrun.yaml
+++ b/examples/drupalsite-restore-taskrun.yaml
@@ -2,13 +2,6 @@ apiVersion: tekton.dev/v1beta1
 kind: TaskRun
 metadata:
   generateName: drupalsite-restore-
-  ownerReferences:
-    - apiVersion: tekton.dev/v1beta1
-      blockOwnerDeletion: true
-      controller: true
-      kind: ClusterTask
-      name: build-test
-      uid: my-uid
 spec:
   taskRef:
     name: drupalsite-restore
-- 
GitLab