Skip to content

Commit

Permalink
KubeVirt as a secondary manager of Container Providers
Browse files Browse the repository at this point in the history
The KubeVirt provider will be managed as a secondary provider of
OpenShift/Kubernetes providers.

The endpoint and authentication of kubevirt will reside under the
container providers, selected by the :kubevirt role and authkey.

Adding and removal of KubeVirt should be performed from the container
manager virtualization tab.
  • Loading branch information
masayag committed Jan 14, 2018
1 parent 2b7c61b commit 461e9e6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
18 changes: 17 additions & 1 deletion app/models/manageiq/providers/kubevirt/infra_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ class ManageIQ::Providers::Kubevirt::InfraManager < ManageIQ::Providers::InfraMa
require_nested :Template
require_nested :Vm

include ManageIQ::Providers::Kubernetes::VirtualizationManagerMixin

belongs_to :parent_manager,
:foreign_key => :parent_ems_id,
:class_name => "ManageIQ::Providers::ContainerManager",
:inverse_of => :virtualization_manager

#
# This is the list of features that this provider supports:
#
Expand Down Expand Up @@ -92,6 +99,15 @@ def verify_credentials(type = nil, opts = {})
with_provider_connection(opts, &:valid?)
end

#
# Verifies that the provider responds to kubevirt resources in order to assure kubevirt is deployed
# on top of the kubernetes cluster
#
def verify_virt_supported
with_provider_connection do |connection|
connection.live_vms
end
end

#
# The ManageIQ core calls this method whenever a connection to the server is needed.
Expand All @@ -100,7 +116,7 @@ def verify_credentials(type = nil, opts = {})
#
def connect(opts = {})
# Get the authentication token:
token = authentication_token()
token = authentication_token(:kubevirt)

# Create and return the connection:
endpoint = default_endpoint
Expand Down
1 change: 1 addition & 0 deletions manageiq-providers-kubevirt.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Gem::Specification.new do |s|
s.files = Dir["{app,config,lib}/**/*"]

s.add_runtime_dependency "kubeclient", "~> 2.4.0"
s.add_runtime_dependency "manageiq-providers-kubernetes", "~> 0.1.0"

s.add_development_dependency "codeclimate-test-reporter", "~> 1.0.0"
s.add_development_dependency "simplecov"
Expand Down

0 comments on commit 461e9e6

Please sign in to comment.