From 2b89bdfb8e4b9a0bf388943fad8c0859cf7f5584 Mon Sep 17 00:00:00 2001 From: Adam Grare Date: Tue, 10 Sep 2024 11:37:12 -0400 Subject: [PATCH] Merge pull request #537 from nasark/subclass_osv_kubevirt Separate OSV and Kubevirt virtualization options from form (cherry picked from commit c73a5bcdf26ca515933adc3c2519582c0d4fc393) --- .../providers/kubernetes/container_manager.rb | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/app/models/manageiq/providers/kubernetes/container_manager.rb b/app/models/manageiq/providers/kubernetes/container_manager.rb index 8cddfe28f5..5e322922a2 100644 --- a/app/models/manageiq/providers/kubernetes/container_manager.rb +++ b/app/models/manageiq/providers/kubernetes/container_manager.rb @@ -328,17 +328,7 @@ def self.params_for_create :skipSubmit => true, :initialValue => 'none', :label => _('Type'), - :options => [ - { - :label => _('Disabled'), - :value => 'none', - }, - { - :label => _('OpenShift Virtualization / KubeVirt'), - :value => 'kubevirt', - :pivot => 'endpoints.kubevirt.hostname', - }, - ], + :options => virtualization_options, }, { :component => 'validate-provider-credentials', @@ -544,6 +534,20 @@ def self.params_for_create } end + def self.virtualization_options + [ + { + :label => _('Disabled'), + :value => 'none', + }, + { + :label => _('KubeVirt'), + :value => 'kubevirt', + :pivot => 'endpoints.kubevirt.hostname', + }, + ] + end + def self.verify_credentials(args) endpoint_name = args.dig("endpoints").keys.first endpoint = args.dig("endpoints", endpoint_name)