argo-cd/resource_customizations/kafka.strimzi.io/KafkaTopic/health.lua
Nick Groszewski 892712a7cb
feat: Add additional strimzi custom resource health checks (#5642)
Add additional strimzi custom resource health checks, including:
* Kafka
* KafkaTopic
* KafkaUser

Contributes to argoproj/argo-cd#5577

Signed-off-by: Nick Groszewski <groszewn@gmail.com>
2021-03-04 14:59:18 +01:00

21 lines
549 B
Lua

hs = {}
if obj.status ~= nil then
if obj.status.conditions ~= nil then
for i, condition in ipairs(obj.status.conditions) do
if condition.type == "NotReady" and condition.status == "True" then
hs.status = "Degraded"
hs.message = condition.message
return hs
end
if condition.type == "Ready" and condition.status == "True" then
hs.status = "Healthy"
hs.message = ""
return hs
end
end
end
end
hs.status = "Progressing"
hs.message = "Waiting for Kafka Topic"
return hs