mirror of
https://github.com/hanzoai/deploy.git
synced 2026-10-07 08:44:50 +00:00
* feat: implement camel.apache.org/Integration CRD health checks Added custom health checks for Camel-K Integration CRDs Signed-off-by: mdebarros <[email protected]> * chore: cleanup up main health.lua Signed-off-by: mdebarros <[email protected]> --------- Signed-off-by: mdebarros <[email protected]> Signed-off-by: mdebarros <[email protected]> Co-authored-by: mdebarros <[email protected]>
25 lines
788 B
Lua
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
|