Khue Doan 2021-11-26 15:23:49 +07:00
parent cb3f7eacc9
commit a2a0b48f0d

View File

@ -18,14 +18,22 @@ data:
return hs
resource.customizations.health.argoproj.io_ApplicationSet: |
hs = {}
hs.status = "Progressing"
hs.message = ""
if obj.status ~= nil then
if obj.status.health ~= nil then
hs.status = obj.status.health.status
if obj.status.health.message ~= nil then
hs.message = obj.status.health.message
if obj.status.conditions ~= nil then
for i, condition in pairs(obj.status.conditions) do
if condition.type == "ErrorOccurred" and condition.status == "True" then
hs.status = "Degraded"
hs.message = condition.message
return hs
end
if condition.type == "ResourcesUpToDate" and condition.status == "True" then
hs.status = "Healthy"
hs.message = condition.message
return hs
end
end
end
end
hs.status = "Progressing"
hs.message = ""
return hs