Skip to content
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

Supports feature attributes #23028

Merged
merged 2 commits into from
May 14, 2024
Merged

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented May 8, 2024

added supports_ columns so the API can determine if the vm supports reconfiguration.

related to #22980

/cc @jeffibm FYI - for the reconfiguration API that is currently on hold

@kbrock
Copy link
Member Author

kbrock commented May 8, 2024

@Fryguy and I discussed with the following thoughts:

while we want to get away from these supports_* columns, they are our current mechanism.

The majority of the use cases of these columns are in the query mechanism, but this case brings back this information to the front end.

@kbrock kbrock force-pushed the supports_feature_attributes branch from 2efb732 to 33b8ad2 Compare May 8, 2024 17:03
@@ -200,6 +201,9 @@ class VmOrTemplate < ApplicationRecord
delegate :connect_lans, :disconnect_lans, :to => :hardware, :allow_nil => true
delegate :queue_name_for_ems_operations, :to => :ext_management_system, :allow_nil => true

supports_attribute :feature => :reconfigure_network_adapters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While here we might as well add the rest which I believe includes CPU memory and disk. @GilbertCherrie can give the details.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kbrock the other 3 item_supports? features in ui-classic are:
:reconfigure_disks
:reconfigure_disksize
:reconfigure_cdroms

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no check for CPU and memory?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

        :allowCpuChange      => role_allows?(:feature => 'vm_reconfigure_cpu'),
        :allowDiskChange     => role_allows?(:feature => 'vm_reconfigure_disks') && item_supports?(:reconfigure_disks),
        :allowDiskSizeChange => item_supports?(:reconfigure_disksize),
        :allowNetworkChange  => item_supports?(:reconfigure_network_adapters) && role_allows?(:feature => 'vm_reconfigure_networks'),
        :allowCdromsChange   => item_supports?(:reconfigure_cdroms) && role_allows?(:feature => 'vm_reconfigure_drives'),
        :isVmwareInfra       => vm.vendor == 'vmware' && vm.type.include?('InfraManager'),
        :isVmwareCloud       => vm.vendor == 'vmware' && vm.type.include?('CloudManager'),
        :isRedhat            => vm.vendor == 'redhat',

@Fryguy This is the whole list. I'm not sure if the role_allows? features are the same as the item_supports? ones or not.

- add 2 supports attributes for vm infra reconfigure field form
- convert a manually defined attribute to using the plugin
@kbrock kbrock force-pushed the supports_feature_attributes branch from 33b8ad2 to 82c37c4 Compare May 9, 2024 15:46
@kbrock
Copy link
Member Author

kbrock commented May 9, 2024

update:

  • added features to vms

not able to reproduce local build failure

@miq-bot
Copy link
Member

miq-bot commented May 9, 2024

Checked commits kbrock/manageiq@f9846b3~...82c37c4 with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint
4 files checked, 0 offenses detected
Everything looks fine. ⭐

@kbrock
Copy link
Member Author

kbrock commented May 9, 2024

@kbrock
Copy link
Member Author

kbrock commented May 14, 2024

@Fryguy any other attributes to add before merging?

@Fryguy Fryguy merged commit 6fb7857 into ManageIQ:master May 14, 2024
8 checks passed
@kbrock kbrock deleted the supports_feature_attributes branch May 14, 2024 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants