Files
Josh Soref 491b3898ac chore(action): minor lua changes (#15580)
* chore(action): add newlines at eof

Signed-off-by: Josh Soref <jsoref@gmail.com>

* chore(action): fix whitespace indentation

Signed-off-by: Josh Soref <jsoref@gmail.com>

* chore(action): use local annotations

Signed-off-by: Josh Soref <jsoref@gmail.com>

---------

Signed-off-by: Josh Soref <jsoref@gmail.com>
2023-09-21 09:20:42 -04:00

23 lines
687 B
Lua

local hs={ status = "Progressing", message = "Waiting for initialization" }
if obj.status ~= nil then
if obj.status.conditions ~= nil then
for i, condition in ipairs(obj.status.conditions) do
if condition.type == "Available" and condition.status ~= "True" then
if condition.reason == "SomePodsNotReady" then
hs.status = "Progressing"
else
hs.status = "Degraded"
end
hs.message = condition.message or condition.reason
end
if condition.type == "Available" and condition.status == "True" then
hs.status = "Healthy"
hs.message = "All instances are available"
end
end
end
end
return hs