mirror of
https://github.com/hanzoai/deploy.git
synced 2026-10-07 08:44:50 +00:00
22 lines
678 B
Lua
22 lines
678 B
Lua
local hs = {}
|
|
if obj.status ~= nil and obj.status.conditions ~= nil then
|
|
for i, condition in ipairs(obj.status.conditions) do
|
|
if condition.type == "Ready" then
|
|
if condition.status == "True" and condition.reason == "SuccessfulCreateOrUpdate" then
|
|
hs.status = "Healthy"
|
|
hs.message = "RabbitMQ queue ready"
|
|
return hs
|
|
end
|
|
|
|
if condition.status == "False" and condition.reason == "FailedCreateOrUpdate" then
|
|
hs.status = "Degraded"
|
|
hs.message = "RabbitMQ queue failed to be created or updated"
|
|
return hs
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
hs.status = "Unknown"
|
|
hs.message = "RabbitMQ queue status is unknown"
|
|
return hs |