mirror of
https://github.com/hanzoai/deploy.git
synced 2026-10-07 08:44:50 +00:00
* Adding Synergy as a ArgoCD user Signed-off-by: GitHub <[email protected]> * Health checking Kafka Connector resources Signed-off-by: Clint Chester <[email protected]> * Includes Kafka Connect Task Failures Signed-off-by: Clint Chester <[email protected]> --------- Signed-off-by: GitHub <[email protected]> Signed-off-by: Clint Chester <[email protected]>
25 lines
944 B
Lua
25 lines
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 |