Files
Josh SorefandGitHub 6d4327e486 chore(action): minor lua changes (#15580)
* 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]>
2023-09-21 09:20:42 -04:00

30 lines
845 B
Lua

local hs = {}
hs.status = "Progressing"
hs.message = "Waiting for machines"
if obj.spec.paused ~= nil and obj.spec.paused then
hs.status = "Suspended"
hs.message = "MachineDeployment is paused"
return hs
end
if obj.status ~= nil and obj.status.phase ~= nil then
if obj.status.phase == "Running" then
hs.status = "Healthy"
hs.message = "Machines are running under this deployment"
end
if obj.status.phase == "ScalingUp" then
hs.status = "Progressing"
hs.message = "Cluster is spawning machines"
end
if obj.status.phase == "ScalingDown" then
hs.status = "Progressing"
hs.message = "Cluster is stopping machines"
end
if obj.status.phase == "Failed" then
hs.status = "Degraded"
hs.message = "MachineDeployment is failed"
end
end
return hs