argo-cd/resource_customizations/platform.confluent.io/Connector/health.lua
Clint Chester 99efafb55a
feat: Confluent Connector Resource Health Checker - #17695 (#17697)
* Adding Synergy as a ArgoCD user

Signed-off-by: GitHub <noreply@github.com>

* Health checking Kafka Connector resources

Signed-off-by: Clint Chester <clint.chester@synergy.net.au>

* Includes Kafka Connect Task Failures

Signed-off-by: Clint Chester <clint.chester@synergy.net.au>

---------

Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: Clint Chester <clint.chester@synergy.net.au>
2024-12-15 15:58:30 -05:00

25 lines
No EOL
944 B
Lua

hs = {}
if obj.status ~= nil and obj.status.state ~= nil then
if obj.status.state == "CREATED" and obj.status.connectorState == "RUNNING" and obj.status.failedTasksCount == nil then
hs.status = "Healthy"
hs.message = "Connector running"
return hs
end
if obj.status.state == "ERROR" then
hs.status = "Degraded"
if obj.status.conditions and #obj.status.conditions > 0 then
hs.message = obj.status.conditions[1].message -- Kafka Connector only has one condition and nests the issues in the error message here
else
hs.message = "No conditions available"
end
return hs
end
if obj.status.failedTasksCount ~= nil and obj.status.failedTasksCount > 0 then
hs.status = "Degraded"
hs.message = "Connector has failed tasks"
return hs
end
end
hs.status = "Progressing"
hs.message = "Waiting for Kafka Connector"
return hs