From ef7a69b2ade4daf32cdaf70c6f6c7115d0c91252 Mon Sep 17 00:00:00 2001
From: Ricardo Rocha <rocha.porto@gmail.com>
Date: Mon, 17 Apr 2023 00:49:00 +0200
Subject: [PATCH] Always try to argocd cluster add

---
 infra/clusters/templates/workflows-cluster.yaml | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/infra/clusters/templates/workflows-cluster.yaml b/infra/clusters/templates/workflows-cluster.yaml
index b85d0b6..e9a7e80 100644
--- a/infra/clusters/templates/workflows-cluster.yaml
+++ b/infra/clusters/templates/workflows-cluster.yaml
@@ -436,12 +436,6 @@ spec:
           echo "y" | argocd login --username admin --password "$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d)" $(kubectl -n argocd get service argocd-server -o jsonpath='{.spec.clusterIP}')
           argocd cluster list
           argocd cluster get {{`{{inputs.parameters.name}}`}}
-          rc=$?
-          if [ "$rc" = "0" ]; then
-            echo "cluster {{`{{inputs.parameters.name}}`}} is already registered. ignoring."
-            exit 0
-          fi
-
           argocd cluster add --name {{`{{inputs.parameters.name}}`}} --kubeconfig /tmp/config {{`{{inputs.parameters.labels}}`}} --upsert default
 
     - name: cluster-config
-- 
GitLab