Files
Clint ChesterandGitHub 251a7d41b7 feat: Confluent Connector Resource Health Checker - #17695 (#17697)
* 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]>
2024-12-15 15:58:30 -05:00

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