Commit 0e9ae67
✨ Generate and use ApplyConfiguration types for Server-Side Apply (#2515)
* Generate apply configuration types for OLM API types
Use controller-gen's applyconfiguration generator to produce typed
apply configuration structs for Server-Side Apply. This adds generated
types for ClusterCatalog, ClusterExtension, ClusterExtensionRevision,
and all their sub-types in applyconfigurations/.
Changes:
- Add applyconfiguration generator to the Makefile generate target
- Add +kubebuilder:ac:generate=true and +kubebuilder:ac:output:package
markers to the API package
- Add SchemeGroupVersion alias required by the generated code
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Use ClusterExtensionRevision ApplyConfiguration types in Boxcutter
Migrate Boxcutter from deprecated client.Patch(ctx, rev, client.Apply)
to typed client.Apply(ctx, rev) using the generated
ClusterExtensionRevisionApplyConfiguration types.
- ClusterExtensionRevisionGenerator interface now returns AC types
- GenerateRevision/GenerateRevisionFromHelmRelease build AC objects
directly via builder pattern instead of API struct literals
- Rename createOrUpdate to apply; uses client.Apply instead of
deprecated client.Patch with client.Apply option
- Owner references set via metav1ac.OwnerReference() builder instead
of controllerutil.SetControllerReference
- BoxcutterStorageMigrator.Migrate uses client.Apply; interface
replaces Create with Apply and adds FieldOwner field
- PhaseSort and helpers operate on AC types natively
- All tests updated to use AC builder pattern and mock Apply
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 3e293ad commit 0e9ae67
39 files changed
Lines changed: 3189 additions & 499 deletions
File tree
- api/v1
- applyconfigurations
- api/v1
- internal
- cmd/operator-controller
- internal/operator-controller/applier
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
201 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
202 | 204 | | |
203 | 205 | | |
204 | 206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
537 | 537 | | |
538 | 538 | | |
539 | 539 | | |
| 540 | + | |
| 541 | + | |
540 | 542 | | |
541 | 543 | | |
542 | 544 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| 255 | + | |
| 256 | + | |
255 | 257 | | |
256 | 258 | | |
257 | 259 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments