Commit 684eeb1
committed
Do not use MustParse to process PVC size
The resource.MustParse function was previously used by the operator to
process the storageSize request provided by the top-level CR. However,
even though defer() and recover() can be used to handle the panic()
generated by that function in case of a wrong user input, that approach
doesn't seem to work properly and the operator crashes without any
chance to recover. The ParseQuantity implementation returns an error
instead of panic(), and it can be easily caught at the operator level.
This change moves away from the MustParse usage and relies on the
ParseQuantity mechanism.
Signed-off-by: Francesco Pantano <fpantano@redhat.com>1 parent 3fbafaa commit 684eeb1
File tree
2 files changed
+13
-4
lines changed- controllers
- pkg/ironicconductor
2 files changed
+13
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
719 | 719 | | |
720 | 720 | | |
721 | 721 | | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
722 | 726 | | |
723 | | - | |
| 727 | + | |
724 | 728 | | |
725 | 729 | | |
726 | 730 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
121 | 126 | | |
122 | 127 | | |
123 | 128 | | |
| |||
298 | 303 | | |
299 | 304 | | |
300 | 305 | | |
301 | | - | |
| 306 | + | |
302 | 307 | | |
303 | 308 | | |
304 | 309 | | |
| |||
352 | 357 | | |
353 | 358 | | |
354 | 359 | | |
355 | | - | |
| 360 | + | |
356 | 361 | | |
0 commit comments