Scope Deployment and PodDisruptionBudget cache to maintenance objects#318
Scope Deployment and PodDisruptionBudget cache to maintenance objects#318fwiesel wants to merge 1 commit into
Conversation
|
Warning Review limit reached
More reviews will be available in 32 minutes and 39 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Without ByObject entries these are cached cluster-wide. The maintenance controller only creates them in kube-system with the cobaltcore-maintenance-controller label.
739dbc8 to
7f518a8
Compare
There was a problem hiding this comment.
Pull request overview
This PR restricts controller-runtime caching for the maintenance controller’s Deployments and PodDisruptionBudgets to the specific objects it creates in kube-system, and also extends the offboarding flow to ensure nova/neutron agent pods are evicted (via a new offboarding taint + status condition) before deleting the Nova compute service.
Changes:
- Scope manager cache for
Deployment/PodDisruptionBudgettokube-systemobjects labeledcobaltcore-maintenance-controller. - Add an offboarding NoExecute taint and compute a new
AgentPodsEvictedHypervisor status condition; gate compute-service deletion on that condition. - Update RBAC and add/extend tests for the new eviction gate and taint behavior.
Reviewed changes
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/controller/offboarding_controller.go | Gate Nova service deletion on AgentPodsEvicted to prevent re-registration. |
| internal/controller/offboarding_controller_test.go | Set/bypass the new condition in existing tests and add a case for waiting behavior. |
| internal/controller/hypervisor_controller.go | Compute and persist AgentPodsEvicted by examining pods on the node. |
| internal/controller/hypervisor_controller_test.go | Add envtest coverage for the new AgentPodsEvicted condition logic. |
| internal/controller/gardener_node_lifecycle_controller.go | Apply offboarding NoExecute taint after VM eviction; watch Hypervisor status changes. |
| internal/controller/gardener_node_lifecycle_controller_test.go | Add tests for offboarding taint application and idempotency. |
| internal/controller/constants.go | Introduce taintKeyOffboarding. |
| api/v1/hypervisor_types.go | Add ConditionTypeAgentPodsEvicted. |
| cmd/main.go | Add ByObject cache scoping for maintenance Deployments/PDBs; preserve global selector behavior. |
| charts/openstack-hypervisor-operator/templates/role.yaml | Grant pods get/list/watch for the new pod inspection logic. |
| go.mod | Promote github.com/go-logr/logr to a direct dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merging this branch will not change overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. |
| // Deployments and PodDisruptionBudgets owned by the maintenance controller | ||
| // always live in kube-system and carry the cobaltcore-maintenance-controller | ||
| // label; restrict the cache to exactly those objects. | ||
| maintenanceSelector, err := labels.Parse("cobaltcore-maintenance-controller") | ||
| if err != nil { | ||
| setupLog.Error(err, "unable to parse maintenance label selector") | ||
| os.Exit(1) | ||
| } | ||
| maintenanceCacheConfig := cache.ByObject{ | ||
| Namespaces: map[string]cache.Config{"kube-system": {}}, | ||
| Label: maintenanceSelector, | ||
| } |
Without
ByObjectentries these are cached cluster-wide. Themaintenance controller only creates them in
kube-systemwith thecobaltcore-maintenance-controllerlabel; restrict the cache toexactly those objects.