diff --git a/resource_customizations/argoproj.io/CronWorkflow/health.lua b/resource_customizations/argoproj.io/CronWorkflow/health.lua index 0843e280d95e2..d1b736743504a 100644 --- a/resource_customizations/argoproj.io/CronWorkflow/health.lua +++ b/resource_customizations/argoproj.io/CronWorkflow/health.lua @@ -7,13 +7,11 @@ if obj.status ~= nil then hs.status = "Degraded" hs.message = condition.message return hs - end - if condition.type == "SubmissionError" and condition.status == "True" then + elseif condition.type == "SubmissionError" and condition.status == "True" then hs.status = "Degraded" hs.message = condition.message return hs - end - if condition.type == "Completed" and condition.status == "True" then + elseif condition.type == "Completed" and condition.status == "True" then hs.status = "Healthy" hs.message = condition.message return hs @@ -22,6 +20,7 @@ if obj.status ~= nil then end end -hs.status = "Progressing" -hs.message = "CronWorkflow is working on executing workflows." +hs.status = "Healthy" +hs.message = "CronWorkflow is healthy." + return hs diff --git a/resource_customizations/argoproj.io/CronWorkflow/health_test.yaml b/resource_customizations/argoproj.io/CronWorkflow/health_test.yaml index 4ae1d2db98de5..d95d066786c15 100644 --- a/resource_customizations/argoproj.io/CronWorkflow/health_test.yaml +++ b/resource_customizations/argoproj.io/CronWorkflow/health_test.yaml @@ -12,6 +12,10 @@ tests: message: "there is a submission error" inputPath: testdata/degradedCronWorkflowWithSubmissionError.yaml - healthStatus: - status: Progressing - message: "CronWorkflow is working on executing workflows." + status: Healthy + message: "CronWorkflow is healthy." inputPath: testdata/noConditionsCronWorkflow.yaml + - healthStatus: + status: Healthy + message: "CronWorkflow is healthy." + inputPath: testdata/withConditionButHealthyCronWorkflow.yaml diff --git a/resource_customizations/argoproj.io/CronWorkflow/testdata/withConditionButHealthyCronWorkflow.yaml b/resource_customizations/argoproj.io/CronWorkflow/testdata/withConditionButHealthyCronWorkflow.yaml new file mode 100644 index 0000000000000..99ada4d5deef2 --- /dev/null +++ b/resource_customizations/argoproj.io/CronWorkflow/testdata/withConditionButHealthyCronWorkflow.yaml @@ -0,0 +1,13 @@ +apiVersion: argoproj.io/v1alpha1 +kind: CronWorkflow +metadata: + name: test-cron-wf + namespace: argocd +spec: + entrypoint: sampleEntryPoint +status: + conditions: + - lastTransitionTime: "2021-11-12T14:28:01Z" + message: this status may be outdated and we may still be progressing + status: "False" + type: SpecError