From 3c1a488185a893cb77dba4266e27ffe3b1b5ebfc Mon Sep 17 00:00:00 2001 From: Nasar Khan Date: Wed, 14 Aug 2024 16:45:06 -0400 Subject: [PATCH] separate osv and kubevirt virtualization options from form --- .../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)