-
Notifications
You must be signed in to change notification settings - Fork 900
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
Remove hardcoded types in favor of a supports feature check #20486
Conversation
[2] pry(main)> ManageIQ::Providers::CloudManager::Template.descendants.select(&:supports_provisioning?).map(&:name)
=> ["ManageIQ::Providers::Amazon::CloudManager::Template",
"ManageIQ::Providers::Azure::CloudManager::Template",
"ManageIQ::Providers::Google::CloudManager::Template",
"ManageIQ::Providers::IbmCloud::PowerVirtualServers::CloudManager::Template",
"ManageIQ::Providers::Openstack::CloudManager::BaseTemplate",
"ManageIQ::Providers::Openstack::CloudManager::Template",
"ManageIQ::Providers::Openstack::CloudManager::VolumeSnapshotTemplate",
"ManageIQ::Providers::Openstack::CloudManager::VolumeTemplate"]
[3] pry(main)> ManageIQ::Providers::InfraManager::Template.descendants.select(&:supports_provisioning?).map(&:name)
=> ["ManageIQ::Providers::Kubevirt::InfraManager::Template",
"ManageIQ::Providers::Redhat::InfraManager::Template",
"ManageIQ::Providers::Microsoft::InfraManager::Template",
"ManageIQ::Providers::Vmware::InfraManager::Template"] Note that |
cc @jaywcarman |
Checked commit Fryguy@9792d9e with ruby 2.6.3, rubocop 0.69.0, haml-lint 0.28.0, and yamllint |
Not sure how I could add specs for this... I don't really like the current spec manageiq/spec/models/miq_template_spec.rb Lines 48 to 62 in 349f28c
because it's not very pluggable. Was thinking maybe each plugin should have their own method that checks that's it's in the eligible list? WDYT? |
Yeah since we're getting rid of the list in core and moving to supports_feature in the plugins, makes sense the specs would move to the plugins also |
Ok, maybe I should do that in a follow up PR, because that will entail a lot more moving parts. |
Part of #19440
Depends on
@agrare Please review.