Catch SSLError too when adding a provider #972
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Expands #314.
KubeException already covers the common "certificate verify failed" SSL errors but not rarer ones like "does not match the server certificate".
This might be resolved in Kubeclient or RestClient one day (ManageIQ/kubeclient#240) but it's blocked on backward compatibility concerns so let's catch it here for now.
So currently some SSL errors can crash

get_hostname_from_routes
leading to no indication except stacktrace in log:This has also been observed as a "Unexpected error encountered" screen which does show the error but makes it hard to proceed.
https://bugzilla.redhat.com/show_bug.cgi?id=1436221
Any SSL error will probably fail both

get_hostname_from_routes
and the main validation code.With this fix, the error from validation will then be displayed in a red flash:
@miq-bot add-label compute/containers, bug, blocker, fine/yes
(per flags on https://bugzilla.redhat.com/show_bug.cgi?id=1436221)
@moolitayer @h-kataria Please review.
P.S. @h-kataria I think ems_common controller used to be more robust, with errors showing in UI, and at some point became more fragile due to JS/JSON response mismatch.