argo-cd/resource_customizations/capabilities.3scale.net/ActiveDoc/health.lua
Adriano Machado d954789d47
feat(server): 3scale health checks (#24327) (#24326)
Signed-off-by: Adriano Machado <60320+ammachado@users.noreply.github.com>
2025-09-06 14:24:18 -04:00

27 lines
1,015 B
Lua

local hs = {}
if obj.status ~= nil and obj.status.conditions ~= nil then
for _, condition in ipairs(obj.status.conditions) do
if condition.type == "Ready" and condition.status == "True" then
hs.status = "Healthy"
hs.message = "3scale ActiveDoc is ready"
return hs
elseif condition.type == "Invalid" and condition.status == "True" then
hs.status = "Degraded"
hs.message = condition.message or "3scale ActiveDoc configuration is invalid"
return hs
elseif condition.type == "Orphan" and condition.status == "True" then
hs.status = "Degraded"
hs.message = condition.message or "3scale ActiveDoc references non-existing resources"
return hs
elseif condition.type == "Failed" and condition.status == "True" then
hs.status = "Degraded"
hs.message = condition.message or "3scale ActiveDoc synchronization failed"
return hs
end
end
end
hs.status = "Progressing"
hs.message = "Waiting for 3scale ActiveDoc status..."
return hs