Commit 2272d9b
authored
🤖 fix: map aggregated OpenAPI schemas to GVK for SSA (#83)
## Summary
Fix aggregated API OpenAPI model metadata so server-side apply can map
`aggregation.coder.com/v1alpha1` resources to structured-merge-diff
types.
## Background
`kubectl apply --server-side` was failing during managed fields
processing with:
- `failed to convert new object to smd typed`
- `no corresponding type for aggregation.coder.com/v1alpha1,
Kind=CoderTemplate`
The aggregated API server defines OpenAPI schemas manually, but those
definitions were missing the `x-kubernetes-group-version-kind` extension
that managedfields uses to index object types.
## Implementation
- Added `x-kubernetes-group-version-kind` extensions to manual OpenAPI
definitions for:
- `CoderWorkspace`
- `CoderWorkspaceList`
- `CoderTemplate`
- `CoderTemplateList`
- Added top-level object fields to the manual schemas (`apiVersion`,
`kind`, `metadata`) and list metadata fields.
- Added regression tests that assert:
- template schema includes the GVK extension and object fields
- managedfields `TypeConverter` can convert a `CoderTemplate` object to
SMD typed form
## Validation
- `make verify-vendor`
- `make test`
- `make build`
- `make lint`
- `GOFLAGS=-mod=vendor go test ./internal/app/apiserverapp -count=1`
## Risks
Low-to-moderate:
- This changes manual OpenAPI model metadata only.
- Main risk is schema shape drift for clients relying on previous
minimal definitions.
- Covered by new unit tests focused on GVK extension and managedfields
conversion.
---
_Generated with [`mux`](https://github.com/coder/mux) • Model:
`openai:gpt-5.3-codex` • Thinking: `xhigh`_
---
_Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking:
`xhigh` • Cost: `$0.29`_
<!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh
costs=0.29 -->1 parent 515a7e4 commit 2272d9b
File tree
2 files changed
+147
-0
lines changed- internal/app/apiserverapp
2 files changed
+147
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
348 | 362 | | |
349 | 363 | | |
350 | 364 | | |
351 | 365 | | |
| 366 | + | |
| 367 | + | |
352 | 368 | | |
353 | 369 | | |
354 | 370 | | |
| |||
365 | 381 | | |
366 | 382 | | |
367 | 383 | | |
| 384 | + | |
368 | 385 | | |
369 | 386 | | |
370 | 387 | | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
371 | 391 | | |
372 | 392 | | |
373 | 393 | | |
| |||
401 | 421 | | |
402 | 422 | | |
403 | 423 | | |
| 424 | + | |
404 | 425 | | |
405 | 426 | | |
406 | 427 | | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
407 | 431 | | |
408 | 432 | | |
409 | 433 | | |
| |||
436 | 460 | | |
437 | 461 | | |
438 | 462 | | |
| 463 | + | |
439 | 464 | | |
440 | 465 | | |
441 | 466 | | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
442 | 470 | | |
443 | 471 | | |
444 | 472 | | |
| |||
450 | 478 | | |
451 | 479 | | |
452 | 480 | | |
| 481 | + | |
453 | 482 | | |
454 | 483 | | |
455 | 484 | | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
456 | 488 | | |
457 | 489 | | |
458 | 490 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
| |||
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
79 | 185 | | |
80 | 186 | | |
81 | 187 | | |
| |||
196 | 302 | | |
197 | 303 | | |
198 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
199 | 314 | | |
200 | 315 | | |
201 | 316 | | |
| |||
0 commit comments