-
Notifications
You must be signed in to change notification settings - Fork 125
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
Convert containers hawkular Endpoints port=nil to port=443 #98
Convert containers hawkular Endpoints port=nil to port=443 #98
Conversation
@cben what if we remove these endpoints altogether? that way we will not have failed authentication checks for an endpoint the user did not intend to create (event if the user does not go into the edit screen and disables metrics altogether) |
These endpoints were only possible by actually going into Hawkular tab and clearing the port field, not sure it's "didn't intend to create" but never mind.
Yeah, I'm fine with deleting too. Don't have an opinion, please decide for me :) cc @yaacov @zeari
Deleting will result in UI showing "Metrics: disabled" in Provider Edit right?
In provider details, will it show as metrics error (ideal IMHO), or not show metrics at all?
|
a. This is fine, when b. In old versions of ManageIQ it was not possible to have no metrics, metrics where always on, and values fall-back to default url. port and token if not given explicitly. IMHO migration of missing endpoint should be to a default values, and to nil/0. |
This looks good to me, I just want approval from @simon3z or @moolitayer before merge. |
+1 for what @yaacov is suggesting here.
This one is actually sad, but I don't have any other good suggestions here. |
I thought this was a situation where the user had pressed add from the
Right |
cb07dca
to
12df92c
Compare
For a time (before ManageIQ/manageiq-ui-classic#1172), it was possible in UI to save containers provider without hawkular port and then it'd be impossible to edit the provider as UI would crash. AFAICT, such providers were effectively using port 443 (builds hawkular url https://<host>/ without port, HTTPS defaults to 443). This migration normalizes such endpoints to port 443. This makes it possible to edit in UI, without adding a nil special case. We'll also be able to simplify hawkular connection code in future. https://bugzilla.redhat.com/show_bug.cgi?id=1432070
Confirmed experimentally, such endpoint is not broken as I originally thought but accesses https URL with port omitted, so it uses port 443. This is also what @yaacov @moolitayer and me saw in code. => Changed migration to set port 443. Dropped down migration, will not change 443 into nil. |
12df92c
to
dd5ed57
Compare
Checked commit cben@dd5ed57 with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0 db/migrate/20171030131403_fix_hawkular_endpoints_with_port_nil.rb
|
@yaacov PTAL |
what about the update_all , don't you want to fix that first ? o/w LGTM 👍 |
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 👍
p.s.
unless you want to change update_all to something else
you mean miq-bot? IIUC we routinely ignore this advice in migrations, because we want migrations to be fast where feasible, and because the model stubs don't normally have validations anyway. @Fryguy please review (nice to have but not blocker) |
yeah, ignore the update_all warning (I keep forgetting to change that in the rubocop.yml) @moolitayer You good with this? |
@simon3z @moolitayer can one of you guys approve this PR? |
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 👍
For a time (before ManageIQ/manageiq-ui-classic#1172), it was possible in UI to save containers provider with blank hawkular port, which got saved as port = nil.
Then it'd be impossible to edit the provider, as UI would crash:
On fine this was fixed by ManageIQ/manageiq-ui-classic#1565 adding special case in UI to tolerate nil.
On master, @AparnaKarve asked to not introduce special cases but do a migration.
Better late than never :-)
After investigating, @yaacov @moolitayer and me concluded such provider does connect to hawkular with port 443 (it builds a url without port, confirmed experimentally).
This migration normalizes such endpoints to port 443, works same but possible to edit in UI:
Tested by checking out fine-1, creating such provider, migrating all the way to master, it was still broken, and fixed by this migration. That's how I took above screenshots.
(in some cases such endpoints might have already been deleted by ManageIQ/manageiq#14990 migration. But not if hostname was autodetected from route => this is still sometimes needed.)
https://bugzilla.redhat.com/show_bug.cgi?id=1432070
@miq-bot add-label bug, data
@moolitayer @AparnaKarve please review