Add ArgoCD health checks for Runner resources
This commit is contained in:
parent
a2ced05a37
commit
070c1a5004
|
|
@ -0,0 +1,54 @@
|
|||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: argocd-cm
|
||||
namespace: argocd
|
||||
data:
|
||||
# Add health check for legacy Runner
|
||||
resource.customizations.health.actions.summerwind.dev_Runner: |
|
||||
hs = {}
|
||||
if obj.status ~= nil then
|
||||
if obj.status.ready == true and obj.status.phase == "Running" then
|
||||
hs.status = "Healthy"
|
||||
hs.message = "Runner is ready and running"
|
||||
elseif obj.status.phase == "Pending" or obj.status.phase == "Created" then
|
||||
hs.status = "Progressing"
|
||||
hs.message = "Runner is starting up"
|
||||
elseif obj.status.phase == "Failed" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = obj.status.message or "Runner has failed"
|
||||
else
|
||||
hs.status = "Progressing"
|
||||
hs.message = "Runner status: " .. (obj.status.phase or "Unknown")
|
||||
end
|
||||
else
|
||||
hs.status = "Progressing"
|
||||
hs.message = "Waiting for runner status"
|
||||
end
|
||||
return hs
|
||||
|
||||
# Add health check for EphemeralRunner
|
||||
resource.customizations.health.actions.github.com_EphemeralRunner: |
|
||||
hs = {}
|
||||
if obj.status ~= nil then
|
||||
if obj.status.phase == "Running" then
|
||||
hs.status = "Healthy"
|
||||
hs.message = "EphemeralRunner is running"
|
||||
elseif obj.status.phase == "Pending" then
|
||||
hs.status = "Progressing"
|
||||
hs.message = "EphemeralRunner is pending"
|
||||
elseif obj.status.phase == "Failed" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = obj.status.message or "EphemeralRunner has failed"
|
||||
elseif obj.status.phase == "Finished" then
|
||||
hs.status = "Healthy"
|
||||
hs.message = "EphemeralRunner has finished"
|
||||
else
|
||||
hs.status = "Progressing"
|
||||
hs.message = "EphemeralRunner status: " .. (obj.status.phase or "Unknown")
|
||||
end
|
||||
else
|
||||
hs.status = "Progressing"
|
||||
hs.message = "Waiting for EphemeralRunner status"
|
||||
end
|
||||
return hs
|
||||
Loading…
Reference in New Issue