From 550a13735ef5e25efe538c6422b59d0b736d4c0b Mon Sep 17 00:00:00 2001
From: Laurent Rochette <laurent.rochette@codefresh.io>
Date: Mon, 14 Aug 2023 18:10:45 +0200
Subject: [PATCH] Issue 637 - v1.3.0 (#639)

* #637: exit with error when not healthy
Signed-off-by: Laurent Rochette <laurent.rochette@codefresh.io>
---
 incubating/argo-cd-sync/argocd_sync.py | 6 ++++--
 incubating/argo-cd-sync/step.yaml      | 4 ++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/incubating/argo-cd-sync/argocd_sync.py b/incubating/argo-cd-sync/argocd_sync.py
index 55a30fbae..71a0c14d6 100644
--- a/incubating/argo-cd-sync/argocd_sync.py
+++ b/incubating/argo-cd-sync/argocd_sync.py
@@ -17,7 +17,7 @@
 
 WAIT_ROLLBACK = True if os.getenv('WAIT_ROLLBACK', "false").lower() == "true" else False
 ROLLBACK    = True if os.getenv('ROLLBACK', "false").lower() == "true" else False
-if WAIT_ROLLBACK: ROLLBACK = True 
+if WAIT_ROLLBACK: ROLLBACK = True
 
 CF_URL      = os.getenv('CF_URL', 'https://g.codefresh.io')
 CF_API_KEY  = os.getenv('CF_API_KEY')
@@ -70,7 +70,9 @@ def main():
     CF_OUTPUT_URL_VAR = CF_STEP_NAME + '_CF_OUTPUT_URL'
     link_to_app = get_link_to_apps_dashboard()
     export_variable(CF_OUTPUT_URL_VAR, link_to_app)
-
+    if status != "HEALTHY":
+        logging.debug("Status is not HEALTHY. Exiting with error.")
+        sys.exit(1)
 
 #######################################################################
 
diff --git a/incubating/argo-cd-sync/step.yaml b/incubating/argo-cd-sync/step.yaml
index ff647ab90..55b2eb1ff 100644
--- a/incubating/argo-cd-sync/step.yaml
+++ b/incubating/argo-cd-sync/step.yaml
@@ -1,7 +1,7 @@
 kind: step-type
 metadata:
   name: argo-cd-sync
-  version: 1.2.2
+  version: 1.3.0
   isPublic: true
   description: Syncs Argo CD apps managed by our GitOps Runtimes
   sources:
@@ -111,7 +111,7 @@ spec:
         },
         "IMAGE_TAG": {
           "type": "string",
-          "default": "1.2.2",
+          "default": "1.3.0",
           "description": "OPTIONAL - To overwrite the tag to use"
         }
       }