mirror of
https://github.com/hanzoai/deploy.git
synced 2026-10-07 08:44:50 +00:00
* Update cert-manager.opcertificate health.lua Signed-off-by: Chris Murray <[email protected]> * adding test case for cert issuing Signed-off-by: Chris Murray <[email protected]> * fixing typo Signed-off-by: Chris Murray <[email protected]> --------- Signed-off-by: Chris Murray <[email protected]>
32 lines
875 B
Lua
32 lines
875 B
Lua
local hs = {}
|
|
if obj.status ~= nil then
|
|
if obj.status.conditions ~= nil then
|
|
|
|
-- Always Handle Issuing First to ensure consistent behaviour
|
|
for i, condition in ipairs(obj.status.conditions) do
|
|
if condition.type == "Issuing" and condition.status == "True" then
|
|
hs.status = "Progressing"
|
|
hs.message = condition.message
|
|
return hs
|
|
end
|
|
end
|
|
|
|
for i, condition in ipairs(obj.status.conditions) do
|
|
if condition.type == "Ready" and condition.status == "False" then
|
|
hs.status = "Degraded"
|
|
hs.message = condition.message
|
|
return hs
|
|
end
|
|
if condition.type == "Ready" and condition.status == "True" then
|
|
hs.status = "Healthy"
|
|
hs.message = condition.message
|
|
return hs
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
hs.status = "Progressing"
|
|
hs.message = "Waiting for certificate"
|
|
return hs
|