Commit 155c12f
committed
OCPBUGS-25191: ic: azure: fix retrieving marketplace image
When openshift#7778 replaced
`errors.Wrap` by `fmt.Errorf` it introduced a bug when retrieving a
marketplace image in the client interface because of their different
behaviors. `errors.Wrap(err, ...)` returns `nil` when `err` is `nil`
whereas `fmt.Errorf` always returns an error. Unfortunately this was not
caught in the unit tests since the client calls are mocked.
This bug resulted in the following error:
```
ERROR failed to fetch Master Machines: failed to load asset "Install Config": failed to create install config: [controlPlane.platform.azure.osImage: Invalid value: azure.OSImage{Plan:"", Publisher:"redhat", Offer:"rh-ocp-worker", SKU:"rh-ocp-worker", Version:"413.92.2023101700"}: could not get marketplace image: %!w(<nil>), compute[0].platform.azure.osImage: Invalid value: azure.OSImage{Plan:"", Publisher:"redhat", Offer:"rh-ocp-worker", SKU:"rh-ocp-worker", Version:"413.92.2023101700"}: could not get marketplace image: %!w(<nil>)]
```1 parent 271f256 commit 155c12f
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
334 | 337 | | |
335 | 338 | | |
336 | 339 | | |
| |||
0 commit comments