mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-02-20 01:28:45 +01:00
Closes #20171 There are valid use cases for InsufficientPods, e.g. running some jobs or tests that don't want to be terminated. See the discussion on the issue for more details. So don't degrade the PDB on InsufficientPods condition. This needs to be cherry picked to 2.13, as many people may not upgrade otherwise. Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>
25 lines
821 B
Lua
25 lines
821 B
Lua
-- Reference CRD can be found here:
|
|
-- https://kubernetes.io/docs/reference/kubernetes-api/policy-resources/pod-disruption-budget-v1/
|
|
hs = {}
|
|
hs.status = "Progressing"
|
|
hs.message = "Waiting for status"
|
|
|
|
if obj.status ~= nil then
|
|
if obj.status.conditions ~= nil then
|
|
for i, condition in ipairs(obj.status.conditions) do
|
|
-- InsufficientPods can have valid use cases
|
|
-- See a discussion in https://github.com/argoproj/argo-cd/issues/20171 for more details
|
|
if condition.status == "False" and condition.reason ~= "InsufficientPods" then
|
|
hs.status = "Degraded"
|
|
hs.message = "PodDisruptionBudget has " .. condition.reason
|
|
return hs
|
|
else
|
|
hs.status = "Healthy"
|
|
hs.message = "PodDisruptionBudget has " .. condition.reason
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
return hs
|