Feature-gated /resource_classes API with ConfigMap storage#772
Conversation
Implement the /resource_classes endpoints following the same pattern established by the traits refactor: a ResourceClassSyncer that owns a single ConfigMap, three feature modes (passthrough, hybrid, crd), and E2E tests that exercise all modes via header override.
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
✨ 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. Review rate limit: 0/1 reviews remaining, refill in 56 minutes and 3 seconds.Comment |
Check and log errors from os.Hostname, ReleaseLock, io.Copy, io.ReadAll, and w.Write in both traits and resource classes handlers/syncers.
|
I'll wait so coderabbit has a chance to review |
Add OpenStack-compliant links array to resource class list/show responses. Add hybrid mode unit tests verifying local ConfigMap updates on upstream success and no-op on upstream failure. Unconditionally start all syncer goroutines regardless of configured mode so the ConfigMap stays warm for header overrides.
In CRD-only mode, there is no upstream placement service to sync from, so starting the background sync goroutine is unnecessary. Gate syncer.Run() on mode != CRD and remove the now-unused syncers slice field from the Shim struct.
Test Coverage ReportTest Coverage 📊: 69.1% |
Implements three-mode support for the /resource_classes placement API endpoints, following the same pattern established in the traits refactor (PR #771). Previously these endpoints only forwarded to upstream placement (returning 501 for hybrid/crd modes). Now passthrough forwards to upstream, hybrid forwards and mirrors locally, and crd serves entirely from a shim-owned ConfigMap. A ResourceClassSyncer periodically fetches upstream state into the ConfigMap so that crd mode can serve without depending on live upstream availability. This is part of the phased placement API migration.
Assisted-by: claude-code:claude-opus-latest [Bash] [Read]