Commit 405a276
committed
fix: fail Deployment tracking fast on ReplicaSet pod-create errors
Problem: during a Deployment rollout, when the child ReplicaSet cannot
create pods (for example `FailedCreate ... exceeded quota`), kubedog did
not surface the failure and tracking hung until timeout.
Root cause: the ReplicaSet controller emits these Warning events with
InvolvedObject set to the ReplicaSet, not the Deployment. The deployment
tracker only ran an event informer for the Deployment object itself, so
ReplicaSet-scoped failures were never observed. StatefulSet and DaemonSet
are unaffected because their controllers emit FailedCreate on the
controller object kubedog already watches.
The fix: start an additional event informer for each new ReplicaSet as
soon as it is discovered (tracked per RS name, so a new ReplicaSet
appearing mid-rollout gets its own informer too), feeding the same
resourceFailed channel the Deployment tracker already reacts to. Any
"Failed*" reason (including FailedCreate: exceeded quota) now interrupts
tracking, consistent with StatefulSet/DaemonSet behavior. Honors
KUBEDOG_DISABLE_EVENTS=1.
It does NOT change the event package, the failure-counting semantics of
dyntracker, or add a new immediate-abort bypass; it only widens what the
Deployment tracker observes.
Verified with go build ./... and go vet ./... on this branch. The
behavior fix was reproduced against the main branch (PR #399), whose
deployment tracker differs from this one only in import paths, using a
kind cluster with a ResourceQuota blocking pod creation: before,
Deployment tracking hung for the full timeout; after, it failed within
seconds with the FailedCreate reason.
Closes #398
Refs #216, #363
Signed-off-by: Alexey Gorovenko <sharvashinho@gmail.com>1 parent 5d57834 commit 405a276
1 file changed
Lines changed: 20 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
112 | | - | |
113 | | - | |
114 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| |||
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
| 170 | + | |
168 | 171 | | |
169 | 172 | | |
170 | 173 | | |
| |||
203 | 206 | | |
204 | 207 | | |
205 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
206 | 217 | | |
207 | 218 | | |
208 | 219 | | |
| |||
655 | 666 | | |
656 | 667 | | |
657 | 668 | | |
658 | | - | |
| 669 | + | |
659 | 670 | | |
660 | 671 | | |
661 | 672 | | |
| |||
0 commit comments