Commit d4a15d8
feat: require tokenRateLimits and remove tokenRateLimitRef for 3.4 (opendatahub-io#644)
## Summary
Related to - https://redhat.atlassian.net/browse/RHOAIENG-55976
This PR makes `tokenRateLimits` required on each `MaaSSubscription`
model reference and removes the unused `tokenRateLimitRef` field from
the CRD.
## Changes
### API Changes
- ✅ Removed `tokenRateLimitRef` field from `ModelSubscriptionRef`
- ✅ Made `tokenRateLimits` required with `MinItems=1` validation
- ✅ Regenerated CRD manifests and deepcopy code
### Tests
- ✅ Fixed 4 unit tests (added missing field indexes)
- ✅ All tests passing
- ✅ Live cluster validation complete
### Documentation
- ✅ Updated CRD reference docs
- ✅ Updated architecture overview
- ✅ Created migration guide:
`docs/content/migration/tokenratelimits-required-3.4.md`
- ✅ Added v3.4.0 release notes with breaking change notice
## Live Cluster Testing Results
(https://console-openshift-console.apps.ci-ln-hdzds3t-76ef8.aws-4.ci.openshift.org/)
Deployed custom controller and verified:
- ✅ Subscriptions **without** `tokenRateLimits` → **REJECTED** with
"Required value" error
- ✅ Subscriptions **with** `tokenRateLimits` → **ACCEPTED**
- ✅ Subscriptions with old `tokenRateLimitRef` → **REJECTED** with
"unknown field" error
- ✅ Controller reconciliation working correctly
- ✅ No RBAC errors
## Migration Impact
**Before (3.3 and earlier):**
```yaml
modelRefs:
- name: my-model
namespace: llm
tokenRateLimits: # Optional
- limit: 1000
window: 1m
tokenRateLimitRef: "some-ref" # Unused by controller
```
**After (3.4+):**
```yaml
modelRefs:
- name: my-model
namespace: llm
tokenRateLimits: # REQUIRED - at least one
- limit: 1000
window: 1m
# tokenRateLimitRef removed
```
## Migration Guide
See detailed migration instructions in
`docs/content/migration/tokenratelimits-required-3.4.md`
Users must add inline `tokenRateLimits` to all `MaaSSubscription`
resources before upgrading to 3.4.
## Acceptance Criteria
All criteria from the user story met:
- [x] `tokenRateLimitRef` not present in API
- [x] Each `modelRefs` entry must include non-empty `tokenRateLimits`
- [x] Validation rejects non-compliant resources with clear messages
- [x] Tests cover required limits, no `tokenRateLimitRef` references
- [x] Generated CRD YAML matches types
- [x] Documentation updated
- [x] Migration guide provided
- [x] Breaking change documented in release notes
## Files Changed
- `maas-controller/api/maas/v1alpha1/maassubscription_types.go` - API
types
-
`deployment/base/maas-controller/crd/bases/maas.opendatahub.io_maassubscriptions.yaml`
- CRD manifest
- `maas-controller/api/maas/v1alpha1/zz_generated.deepcopy.go` -
Generated code
-
`maas-controller/pkg/controller/maas/maassubscription_controller_test.go`
- Test fixes
-
`docs/content/configuration-and-management/maas-controller-overview.md`
- Architecture docs
- `docs/content/reference/crds/maas-subscription.md` - CRD reference
- `docs/content/migration/tokenratelimits-required-3.4.md` - Migration
guide (new)
- `docs/content/release-notes/index.md` - Release notes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## Release Notes
* **Breaking Changes**
* Rate limit configuration for each model subscription is now mandatory
and must be specified inline rather than referenced externally
* At least one rate limit entry is required per model
* Rate limit values must be greater than zero
* **Documentation**
* Updated configuration and CRD documentation to reflect new rate limit
requirements
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 6b2d7e4 commit d4a15d8
File tree
7 files changed
+22
-18
lines changed- deployment/base/maas-controller/crd/bases
- docs/content
- configuration-and-management
- reference/crds
- release-notes
- maas-controller
- api/maas/v1alpha1
- pkg/controller/maas
7 files changed
+22
-18
lines changedLines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | 79 | | |
84 | 80 | | |
85 | 81 | | |
| |||
89 | 85 | | |
90 | 86 | | |
91 | 87 | | |
| 88 | + | |
92 | 89 | | |
93 | 90 | | |
94 | 91 | | |
| |||
99 | 96 | | |
100 | 97 | | |
101 | 98 | | |
| 99 | + | |
102 | 100 | | |
103 | 101 | | |
104 | 102 | | |
105 | 103 | | |
| 104 | + | |
106 | 105 | | |
107 | 106 | | |
108 | 107 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
| 195 | + | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
| 27 | + | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
3 | 13 | | |
4 | 14 | | |
5 | 15 | | |
| |||
Lines changed: 3 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 67 | + | |
| 68 | + | |
73 | 69 | | |
74 | 70 | | |
75 | 71 | | |
| |||
79 | 75 | | |
80 | 76 | | |
81 | 77 | | |
| 78 | + | |
82 | 79 | | |
83 | 80 | | |
84 | 81 | | |
| |||
Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
| 400 | + | |
400 | 401 | | |
401 | 402 | | |
402 | 403 | | |
| |||
492 | 493 | | |
493 | 494 | | |
494 | 495 | | |
| 496 | + | |
495 | 497 | | |
496 | 498 | | |
497 | 499 | | |
| |||
717 | 719 | | |
718 | 720 | | |
719 | 721 | | |
| 722 | + | |
720 | 723 | | |
721 | 724 | | |
722 | 725 | | |
| |||
810 | 813 | | |
811 | 814 | | |
812 | 815 | | |
| 816 | + | |
813 | 817 | | |
814 | 818 | | |
815 | 819 | | |
| |||
0 commit comments