Skip to content

Scope Deployment and PodDisruptionBudget cache to maintenance objects#318

Open
fwiesel wants to merge 1 commit into
mainfrom
scope-maintenance-cache
Open

Scope Deployment and PodDisruptionBudget cache to maintenance objects#318
fwiesel wants to merge 1 commit into
mainfrom
scope-maintenance-cache

Conversation

@fwiesel

@fwiesel fwiesel commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Without ByObject entries these are cached cluster-wide. The
maintenance controller only creates them in kube-system with the
cobaltcore-maintenance-controller label; restrict the cache to
exactly those objects.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@fwiesel, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 51583411-df68-4b21-a511-157521f9d915

📥 Commits

Reviewing files that changed from the base of the PR and between 441452b and 7f518a8.

📒 Files selected for processing (1)
  • cmd/main.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch scope-maintenance-cache

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Without ByObject entries these are cached cluster-wide. The
maintenance controller only creates them in kube-system with the
cobaltcore-maintenance-controller label.
@fwiesel fwiesel force-pushed the scope-maintenance-cache branch from 739dbc8 to 7f518a8 Compare June 19, 2026 10:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/PodDisruptionBudget to kube-system objects labeled cobaltcore-maintenance-controller.
  • Add an offboarding NoExecute taint and compute a new AgentPodsEvicted Hypervisor 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.

Comment thread cmd/main.go
@github-actions

Copy link
Copy Markdown

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/cobaltcore-dev/openstack-hypervisor-operator/cmd 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/cobaltcore-dev/openstack-hypervisor-operator/cmd/main.go 0.00% (ø) 0 0 0

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread cmd/main.go
Comment on lines +184 to +195
// 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,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants