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

KubeVirt as a secondary manager of Container Providers #6

Merged
merged 1 commit into from
Jan 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this one adds dependency on the manageiq-providers-kubernetes project, therefore we add an explicit dependency on it


belongs_to :parent_manager,
:foreign_key => :parent_ems_id,
:class_name => "ManageIQ::Providers::ContainerManager",
:inverse_of => :infra_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