-
Notifications
You must be signed in to change notification settings - Fork 898
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In order to support kubevirt as a secondary manager of the openshift/kubevirt provider, a new mixin is added to represent that capability.
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module HasVirtualizationManagerMixin | ||
extend ActiveSupport::Concern | ||
|
||
private | ||
|
||
def ensure_virtualization_manager | ||
# virtualization_manager should be defined by child classes. | ||
if try(:virtualization_manager_needed?) | ||
build_virtualization_manager(:parent_manager => self) | ||
virtualization_manager.name = "#{name} Virtualization Manager" | ||
end | ||
ensure_virtualization_manager_properties | ||
end | ||
|
||
def ensure_virtualization_manager_properties | ||
if virtualization_manager | ||
virtualization_manager.zone_id = zone_id | ||
virtualization_manager.provider_region = provider_region | ||
end | ||
end | ||
end |