Commit 81c03b9
authored
fix: wait for image conversion before reporting build ready (KERNEL-863) (#65)
* fix: wait for image conversion before reporting build ready (KERNEL-863)
Fixes a race condition where build status would transition to "ready"
before the image conversion completed, causing instance creation to fail.
The registry's triggerConversion() runs asynchronously after returning
201 to the builder. This meant the builder could report success and
the build manager would set status="ready" while image conversion was
still in progress.
Changes:
- Add imageManager dependency to build manager
- Add waitForImageReady() that polls until image status is "ready"
- Call waitForImageReady() before setting build to "ready" status
- If image conversion fails/times out, mark build as failed
* fix: use buildCtx for image wait and recalculate duration
Addresses PR review feedback:
1. Use buildCtx instead of ctx for waitForImageReady to respect
build timeout during image conversion wait
2. Recalculate duration after waitForImageReady completes to
accurately report total build time including image conversion1 parent 57b83c1 commit 81c03b9
File tree
5 files changed
+403
-5
lines changed- cmd/api
- lib
- builds
- providers
5 files changed
+403
-5
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| |||
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| 109 | + | |
108 | 110 | | |
109 | 111 | | |
110 | 112 | | |
| |||
119 | 121 | | |
120 | 122 | | |
121 | 123 | | |
| 124 | + | |
122 | 125 | | |
123 | 126 | | |
124 | 127 | | |
| |||
294 | 297 | | |
295 | 298 | | |
296 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
297 | 322 | | |
298 | 323 | | |
299 | 324 | | |
| |||
303 | 328 | | |
304 | 329 | | |
305 | 330 | | |
306 | | - | |
| 331 | + | |
307 | 332 | | |
308 | 333 | | |
309 | 334 | | |
| |||
640 | 665 | | |
641 | 666 | | |
642 | 667 | | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
643 | 706 | | |
644 | 707 | | |
645 | 708 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
219 | 220 | | |
220 | 221 | | |
221 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
222 | 294 | | |
223 | 295 | | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
224 | 302 | | |
225 | 303 | | |
226 | 304 | | |
| |||
236 | 314 | | |
237 | 315 | | |
238 | 316 | | |
| 317 | + | |
239 | 318 | | |
240 | 319 | | |
241 | 320 | | |
| |||
257 | 336 | | |
258 | 337 | | |
259 | 338 | | |
| 339 | + | |
260 | 340 | | |
261 | 341 | | |
262 | 342 | | |
263 | 343 | | |
264 | 344 | | |
265 | 345 | | |
266 | | - | |
| 346 | + | |
267 | 347 | | |
268 | 348 | | |
269 | 349 | | |
| |||
0 commit comments