Skip to content

Commit

Permalink
chore: Don't degrade PDB on InsufficientPods (#20171)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
andrii-korotkov-verkada committed Nov 5, 2024
1 parent eb10b70 commit 846cb1a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ 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
if condition.status == "False" then
-- InsufficientPods can have valid use cases
-- See a discussion in https://github.com/argoproj/argo-cd/issues/20171 for more details
if condition != "InsufficientPods" and condition.status == "False" then
hs.status = "Degraded"
hs.message = "PodDisruptionBudget has " .. condition.reason
return hs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ tests:
inputPath: testdata/progressing.yaml
- healthStatus:
status: Degraded
message: 'PodDisruptionBudget has InsufficientPods'
message: 'PodDisruptionBudget has SyncFailed'
inputPath: testdata/degraded.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ status:
reason: InsufficientPods
status: "False"
type: DisruptionAllowed
- lastTransitionTime: "2024-09-06T18:29:06Z"
message: ""
observedGeneration: 2
reason: SyncFailed
status: "False"
type: DisruptionAllowed
currentHealthy: 2
desiredHealthy: 3
disruptionsAllowed: 0
Expand Down

0 comments on commit 846cb1a

Please sign in to comment.