-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix adding Kubernetes provider #314
Fix adding Kubernetes provider #314
Conversation
@enoodle @moolitayer please review |
@miq-bot assign cben |
@yaacov welcome back, can you review? |
LGTM 👍 |
Confirmed, it's currently impossible to add Kubernetes provider via UI! Checking euwe... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one comment though:
I know that we are not collecting them yet, but Kubernetes have introduced a new object called ingress that is a bit similar to Openshift Routes [1]. Maybe we can add a TODO here to remember to check with the ingress once we collect them (Possibly we will collect ingress under the route entity in ManageIQ)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
I know that we are not collecting them yet, but Kubernetes have introduced
a new object called ingress that is a bit similar to Openshift Routes [1].
Maybe we can add a TODO here to remember to check with the ingress once we
collect them (Possibly we will collect ingress under the route entity in
ManageIQ)
This is direct request, independent of refresh (it can run before adding
the provider). So we could do it right now, assuming Kubeclient supports
it.
But not having the route API was just a symptom, I believe people don't
normally run hawkular-metrics at on kubernetes...
(Or at least it's highly atypical; if one does it explicitly filling
hostname in Hawkular endpoint should still work.)
|
euwe is unaffected.
@miq-bot add-label euwe/no
|
@cben please add tests |
Routes are an Openshift concept, no such tning in Kubernetes API. This should be best-effort, failure to get the hawkular route should not prevent validating/saving the provider (if it otherwise passes).
65f1cde
to
7b6fe36
Compare
Checked commit cben@7b6fe36 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 spec/controllers/ems_common_controller_spec.rb
|
Added tests, @yaacov please review. More integration than unit test, because I have hopes to refactor this route fetching to later point when the EMS is already built, and I don't want tests to depend on current interface. @yaacov the tests call Consciously ignoring Rubocop here. There are bigger issues with these tests but this is a step forward. [close-cycling to kick travis, bower EINCOMPLETE] |
LGTM 👍 |
@miq-bot assign dclarizio |
Well I have to ask why we have so much provider-specific code in a mixin that should have contained the common code for all the providers. But that is not the fault of this PR. |
Expands ManageIQ#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. get_hostname_from_routes is best-effort, should never crash UI. Any SSL error will probably fail both get_hostname_from_routes and the main validation code; the error from validation will then be displayed in a red flash. https://bugzilla.redhat.com/show_bug.cgi?id=1436221
Reported by @evertmulder yesterday, also encountered by @AparnaKarve and by me today.
If
get_hostname_from_routes
causes exception, you can't [Validate] nor [Add]/[Save] the provider.This was especially a problem for Kubernetes, apparently made it impossible to create Kubernetes provider via UI.
(Not sure if recent #265 made it more exception-prone? I can confirm the guessing does work on Openshift.)
IIUC this functionality should be best-effort, failure to guess the hawkular route should not stop block user (if they can make validation happy otherwise).
(The error also doesn't get to UI, the 500 JS page is not the JSON the UI was looking for. That could be improved but in this case I believe errors are not interesting to user anyway.)
@simon3z Please review.
@miq-bot add-label providers/containers, bug