mirror of
https://github.com/khuedoan/homelab.git
synced 2024-12-23 01:04:32 +07:00
fix(bootstrap): fix ApplicationSet health check
https://github.com/argoproj/argo-cd/blob/master/resource_customizations/argoproj.io/ApplicationSet/health.lua
This commit is contained in:
parent
cb3f7eacc9
commit
a2a0b48f0d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user