-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not use MustParse with wrong StorageRequest size
In case of a wrong user input, the operator crashes without any chance to recover. The MustParse implementation wraps the ParseQuantity function, that instead of panic() returns an error that can be easily handled at the operator level. This change does not alter the current behavior, but it adds a preliminary check that does not let the validation to continue if the quantity is not valid. It also moves away from MustParse in favor of ParseQuantity. By doing this we can get a webhook feedback about the wrong quantity instead of checking the operators log and see the panic stacktrace. Signed-off-by: Francesco Pantano <fpantano@redhat.com>
- Loading branch information
Showing
2 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters