-
Notifications
You must be signed in to change notification settings - Fork 63
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
Support KubeVirt provider #197
Conversation
@miq-bot add_labels enhancement, gaprindashvili/no |
@@ -0,0 +1,39 @@ | |||
module ManageIQ::Providers::Kubernetes::VirtualizationManagerMixin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't seem to find where this is used?
(except for this)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is used in the kubevirt provider repo: https://github.com/ManageIQ/manageiq-providers-kubevirt/pull/6/files#diff-ff17b05a7c525eec833f0ddb0134a0d9R26
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@moolitayer I've updated the PR message to reference the other related PRs (ui-classic and kubevirt provider)
@moolitayer I need to update the current version of the PR. Will nag when ready for review. |
thanks |
edd7b9a
to
8bbe7bc
Compare
it "Creates a virtualization manager when container manager is updated with a kubevirt endpoint" do | ||
ems = FactoryGirl.create(:ems_kubernetes) | ||
kubevirt_endpoint = FactoryGirl.create(:endpoint, :role => 'kubevirt', :hostname => 'host', :resource => ems) | ||
ems.endpoints << kubevirt_endpoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zeari @moolitayer this specific test fails with:
/home/masayag/work/manageiq-master/app/models/ext_management_system.rb:95:in hostname_format_valid?'
...
# /home/masayag/.rvm/gems/ruby-2.3.3/gems/activerecord-5.0.6/lib/active_record/suppressor.rb:41:insave' # /home/masayag/work/manageiq-master/app/models/mixins/has_virtualization_manager_mixin.rb:8:in
virtualization_endpoint_created'
# /home/masayag/work/manageiq-master/app/models/manageiq/providers/container_manager.rb:104:inendpoint_created' # /home/masayag/work/manageiq-master/app/models/endpoint.rb:17:in
endpoint_created'
It appears that even though the endpoint_created was called twice (for 'default' and 'kubevirt'), before saving the virtualization manager, there is 'default' endpoint.
Any ideas ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an error related to the validity of the hostname?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try
it "Creates a virtualization manager when container manager is updated with a kubevirt endpoint" do
ems = FactoryGirl.create(:ems_kubernetes, :endpoints => [FactoryGirl.build(:endpoint, :role => 'default', :hostname => 'iamahostname'])
kubevirt_endpoint = FactoryGirl.create(:endpoint, :role => 'kubevirt', :hostname => 'host', :resource => ems)
# ems.endpoints << kubevirt_endpoint ----- you dont need this because of :resource => ems
expect(ems.virtualization_manager).not_to be_nil
expect(ems.virtualization_manager.parent_manager).to eq(ems)
expect(ems.virtualization_manager.default_endpoint.role).to eq("kubevirt")
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zeari that didn't do the trick.
I ended up with creating an endpoint (via FactoryGirl.build
) and in the next line added it to the ems.endpoints
That seems to satisfy the spec.
31323c0
to
c65977a
Compare
The kubevirt provider will be managed as a virtualization manager under the container managers. The endpoint and authentication of kubevirt will be selected by :kubevirt role and authkey.
c65977a
to
c16eb0d
Compare
Checked commit masayag@c16eb0d with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0 app/models/manageiq/providers/kubernetes/container_manager_mixin.rb
|
@zeari I've updated the PR according to Adam's comments on the core PR (renamed the virtualization_manger to infra_manager). |
@masayag looks like some valid test failures |
Travis isn't running and the test suite passes locally, just going to merge this to fix the errors on master |
The kubevirt provider will be managed as a virtualization manager under
the container managers.
The endpoint and authentication of kubevirt will be selected by
:kubevirt role and authkey.
This PR depends on ManageIQ/manageiq#16721.
Additional related PRs:
UI PR:
ManageIQ/manageiq-ui-classic#3143
kubevirt provider PR:
ManageIQ/manageiq-providers-kubevirt#6