Skip to content

Commit

Permalink
fix: CronWorkflow should be healthy when not executing workflows (arg…
Browse files Browse the repository at this point in the history
…oproj#8594)

Signed-off-by: Yuan Tang <[email protected]>
  • Loading branch information
terrytangyuan authored Feb 23, 2022
1 parent ebc89ce commit 9631667
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
11 changes: 5 additions & 6 deletions resource_customizations/argoproj.io/CronWorkflow/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9631667

Please sign in to comment.