mirror of
https://github.com/hanzoai/deploy.git
synced 2026-10-07 08:44:50 +00:00
* chore(action): add newlines at eof Signed-off-by: Josh Soref <[email protected]> * chore(action): fix whitespace indentation Signed-off-by: Josh Soref <[email protected]> * chore(action): use local annotations Signed-off-by: Josh Soref <[email protected]> --------- Signed-off-by: Josh Soref <[email protected]>
30 lines
990 B
Lua
30 lines
990 B
Lua
local adopted = { status = "Unknown" }
|
|
local advertised = { status = "Unknown" }
|
|
local discovered = { status = "Unknown" }
|
|
|
|
if obj.status ~= nil then
|
|
if obj.status.conditions ~= nil then
|
|
for i, c in ipairs(obj.status.conditions) do
|
|
if c.type == "Adopted" then
|
|
adopted = c
|
|
elseif c.type == "Advertised" then
|
|
advertised = c
|
|
elseif c.type == "Discoverable" then
|
|
discovered = c
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
if adopted.status == "False" then
|
|
return { status = "Degraded", message = adopted.message }
|
|
elseif advertised.reason == "AdvertiseError" or advertised.reason == "UnadvertiseError" then
|
|
return { status = "Degraded", message = advertised.message }
|
|
elseif discovered.reason == "DiscoveryError" then
|
|
return { status = "Unknown", message = discovered.message }
|
|
elseif discovered.status == "True" then
|
|
return { status = "Healthy", message = discovered.message }
|
|
else
|
|
return { status = "Progressing", message = discovered.message }
|
|
end
|