Files
Miguel de Barros 1e2f5987d2 feat(issue/#17003): implement camel.apache.org/Integration CRD health checks (#17004)
* feat: implement camel.apache.org/Integration CRD health checks

Added custom health checks for Camel-K Integration CRDs

Signed-off-by: mdebarros <migueld@debarros.me>

* chore: cleanup up main health.lua

Signed-off-by: mdebarros <miguel@debarros.me>

---------

Signed-off-by: mdebarros <migueld@debarros.me>
Signed-off-by: mdebarros <miguel@debarros.me>
Co-authored-by: mdebarros <migueld@debarros.me>
2024-05-30 14:35:19 +03:00

25 lines
788 B
Lua

local hs = {}
if obj.status ~= nil then
if obj.status.conditions ~= nil then
for i, condition in ipairs(obj.status.conditions) do
-- Let's check if something is wrong with the CRD deployment
if condition.type == "Ready" and condition.status == "False" then
hs.status = "Degraded"
hs.message = condition.message
return hs
end
-- Let's check if things are healthy with the CRD deployment
if condition.type == "Ready" and condition.status == "True" then
hs.status = "Healthy"
hs.message = condition.message
return hs
end
end
end
end
-- Otherwise let's assume that we are still busy building/deploying the Integration
hs.status = "Progressing"
hs.message = "Waiting for Integration"
return hs