-
Notifications
You must be signed in to change notification settings - Fork 899
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
Allow ovirt to implement their own pg version check #19090
Allow ovirt to implement their own pg version check #19090
Conversation
This doesn't fix the following bug but allows them to implement their own adapter that opts-out of the manageiq pg version check and instead implement their own via a check_version, something like this: ```ruby module ActiveRecord module ConnectionHandling # :nodoc: def ovirt_postgresql_connection(config) conn_params = config.symbolize_keys ...rest of the existing rails 5.1 pg adapter method until... ConnectionAdapters::OvirtPostgreSQLAdapter.new(nil, logger, conn_params, config) end end module ConnectionAdapters class OvirtPostgreSQLAdapter < PostgreSQLAdapter def check_version raise "AAAAA" if postgresql_version > XXX end end end end ``` https://bugzilla.redhat.com/show_bug.cgi?id=1734770
@gekorob Please test this and let me know how it goes... I think this is the interface we want... allow adapters to opt-out of the version check or implement their own |
Checked commit jrafanie@b3f3f57 with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 |
@jrafanie I applied the patch to the initializer, reproduced the problem locally and build the new postgresql adapter with the check condition set to allow postgresql major of 9.2. And it worked. |
@carbonin please review... I added a link to the consumer of this change: ManageIQ/ovirt_metrics#33 |
…r_own_pg_check_version Allow ovirt to implement their own pg version check (cherry picked from commit e530796) https://bugzilla.redhat.com/show_bug.cgi?id=1734770
Ivanchuk backport details:
|
Latest version of ovirt_metrics implements a custom PostgreSQLAdapter to override the MIQ check_version method and allow connections to PG older than v.10. Related to ManageIQ#19090 This should fix https://bugzilla.redhat.com/show_bug.cgi?id=1734770
Latest version of ovirt_metrics implements a custom PostgreSQLAdapter to override the MIQ check_version method and allow connections to PG older than v.10. Related to ManageIQ#19090 This should fix https://bugzilla.redhat.com/show_bug.cgi?id=1734770
Latest version of ovirt_metrics implements a custom PostgreSQLAdapter to override the MIQ check_version method and allow connections to PG older than v.10. Related to ManageIQ#19090 This should fix https://bugzilla.redhat.com/show_bug.cgi?id=1734770
This doesn't fix the following bug but allows them to implement their
own adapter that opts-out of the manageiq pg version check and instead
implement their own via a check_version, something like this:
ManageIQ/ovirt_metrics#33
https://bugzilla.redhat.com/show_bug.cgi?id=1734770