Commit cfcfde6
committed
chore(STONEINTG-1189): annotate PLR when component missing
This fixes a silent failure where the Build PipelineRun would stall if
the appstudio.openshift.io/component label was incorrect, not found,
or missing entirely.
Changes:
* Added logic to catch 'Component Not Found' errors during loader.
* Added logic to catch cases where the component label is nil.
* In both cases, the PipelineRun is now annotated with
test.appstudio.openshift.io/create-snapshot-status='failed'.
* Ensured Finalizer is removed if component is not found, allowing
resource deletion.
Testing:
* Added unit tests in buildpipeline_controller_test.go covering
both scenarios.
Generated-by: Cursor
Signed-off-by: jcullina <[email protected]>1 parent 0076e2d commit cfcfde6
File tree
2 files changed
+42
-2
lines changed- internal/controller/buildpipeline
2 files changed
+42
-2
lines changedLines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
89 | 95 | | |
90 | 96 | | |
91 | 97 | | |
| |||
105 | 111 | | |
106 | 112 | | |
107 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
108 | 119 | | |
109 | 120 | | |
110 | 121 | | |
| |||
Lines changed: 31 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
297 | 298 | | |
298 | 299 | | |
299 | 300 | | |
300 | | - | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
301 | 312 | | |
302 | 313 | | |
303 | 314 | | |
| |||
371 | 382 | | |
372 | 383 | | |
373 | 384 | | |
374 | | - | |
375 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
376 | 405 | | |
377 | 406 | | |
0 commit comments