Commit 632f288
authored
Support custom resources with scale subresource in checkOwnerRef (#306)
Support custom resources with scale subresource in checkOwnerRef
The checkOwnerRef function was previously hardcoded to only accept
ReplicaSet and StatefulSet as valid owner references, preventing the
WPA from working with custom resources that implement the scale
subresource.
This change removes the kind restriction, allowing the WPA to autoscale
any resource type that implements the scale subresource (e.g., custom
controllers like EphemeraKV). The special handling for ReplicaSets
(stripping the generated suffix to match Deployment names) is preserved,
while all other resource kinds now match directly by name.
Changes:
- Remove kind restriction in checkOwnerRef() to support any owner reference
- Add test cases for custom resource types (EphemeraKV, CustomController)
- Maintain backward compatibility with Deployment and StatefulSet
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
Co-authored-by: cedric.lamoriniere <[email protected]>1 parent 5b023ba commit 632f288
File tree
2 files changed
+46
-5
lines changed- controllers/datadoghq
2 files changed
+46
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
557 | 557 | | |
558 | 558 | | |
559 | 559 | | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | 560 | | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
565 | 564 | | |
566 | | - | |
567 | 565 | | |
568 | 566 | | |
569 | 567 | | |
570 | 568 | | |
571 | 569 | | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
572 | 574 | | |
573 | 575 | | |
574 | 576 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3245 | 3245 | | |
3246 | 3246 | | |
3247 | 3247 | | |
| 3248 | + | |
| 3249 | + | |
| 3250 | + | |
| 3251 | + | |
| 3252 | + | |
| 3253 | + | |
| 3254 | + | |
| 3255 | + | |
| 3256 | + | |
| 3257 | + | |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
| 3261 | + | |
| 3262 | + | |
| 3263 | + | |
| 3264 | + | |
| 3265 | + | |
| 3266 | + | |
| 3267 | + | |
| 3268 | + | |
| 3269 | + | |
| 3270 | + | |
| 3271 | + | |
| 3272 | + | |
| 3273 | + | |
| 3274 | + | |
| 3275 | + | |
| 3276 | + | |
| 3277 | + | |
| 3278 | + | |
| 3279 | + | |
| 3280 | + | |
| 3281 | + | |
| 3282 | + | |
| 3283 | + | |
| 3284 | + | |
| 3285 | + | |
| 3286 | + | |
3248 | 3287 | | |
3249 | 3288 | | |
3250 | 3289 | | |
| |||
0 commit comments