Commit b32665e
authored
feat(carvel): emit cross-deployment consumes on runtime config addon job (#666)
## Summary
- Extends the \`job-spec-overlay\` sidecar format with two optional
fields: \`from\` and \`deployment\`
- When set on a \`boshLinkConsumer\` entry, \`generateRuntimeConfigs()\`
now includes the link in the \`registry-data\` addon job's \`consumes:\`
map using the BOSH cross-deployment link resolution schema
- Extracts a \`readJobSpecOverlays()\` helper so overlay-reading is
shared between \`generateBoshReleaseDir()\` and
\`generateRuntimeConfigs()\` rather than duplicated
## Motivation
Tile authors currently have to post-process the built \`.pivotal\` to
inject a \`consumes:\` block into the runtime config addon job after
\`kiln carvel bake\`. This change makes it possible to declare
cross-deployment link resolution natively in the sidecar files,
eliminating the need for that patch step.
## Example overlay
```yaml
consumes:
- name: nats-tls
type: nats-tls
optional: false
from: nats-tls
deployment: "(( ..cf.deployment_name ))"
- name: binding_cache
type: binding_cache
optional: true
from: binding_cache
deployment: "(( ..cf.deployment_name ))"
```
Generated runtime config addon job will include:
```yaml
consumes:
nats-tls:
from: nats-tls
deployment: (( ..cf.deployment_name ))
binding_cache:
from: binding_cache
deployment: (( ..cf.deployment_name ))
```
## Test plan
- [ ] \`go test ./internal/carvel/...\` passes (unit + integration
tests)
- [ ] New unit tests: \`jobSpecOverlay\` parses \`from\`/\`deployment\`
fields correctly, including partial presence (only \`from\` set, only
\`deployment\` set)
- [ ] Updated integration test:
\`addon.Jobs[0].Consumes["binding_cache"]\` has expected
\`From\`/\`Deployment\` values in the generated runtime config
- [ ] Entries without \`from\`/\`deployment\` are unaffected (no
\`consumes:\` key emitted)
🤖 Generated with [Claude Code](https://claude.com/claude-code)4 files changed
Lines changed: 145 additions & 26 deletions
File tree
- internal/carvel
- models
- testdata/sample-tile/packageinstalls
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
| 260 | + | |
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
275 | | - | |
276 | | - | |
| 275 | + | |
| 276 | + | |
277 | 277 | | |
278 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
279 | 281 | | |
280 | 282 | | |
281 | 283 | | |
282 | 284 | | |
283 | 285 | | |
284 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
285 | 313 | | |
286 | 314 | | |
| 315 | + | |
| 316 | + | |
287 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
288 | 328 | | |
289 | 329 | | |
290 | 330 | | |
| |||
293 | 333 | | |
294 | 334 | | |
295 | 335 | | |
| 336 | + | |
| 337 | + | |
296 | 338 | | |
297 | 339 | | |
298 | 340 | | |
| |||
355 | 397 | | |
356 | 398 | | |
357 | 399 | | |
358 | | - | |
359 | 400 | | |
360 | 401 | | |
361 | 402 | | |
| |||
416 | 457 | | |
417 | 458 | | |
418 | 459 | | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | 460 | | |
435 | 461 | | |
436 | 462 | | |
| |||
443 | 469 | | |
444 | 470 | | |
445 | 471 | | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
446 | 476 | | |
447 | 477 | | |
448 | | - | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
449 | 483 | | |
450 | 484 | | |
451 | 485 | | |
| |||
461 | 495 | | |
462 | 496 | | |
463 | 497 | | |
464 | | - | |
| 498 | + | |
465 | 499 | | |
466 | 500 | | |
467 | 501 | | |
| |||
717 | 751 | | |
718 | 752 | | |
719 | 753 | | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
720 | 770 | | |
721 | 771 | | |
722 | 772 | | |
723 | 773 | | |
724 | 774 | | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
725 | 778 | | |
726 | 779 | | |
727 | 780 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
283 | 332 | | |
284 | 333 | | |
285 | 334 | | |
| |||
455 | 504 | | |
456 | 505 | | |
457 | 506 | | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
458 | 513 | | |
459 | 514 | | |
460 | 515 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
0 commit comments