-
Notifications
You must be signed in to change notification settings - Fork 897
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
CloudNetwork, NetworkPort and SecurityGroup belong to a ResourceGroup #19343
CloudNetwork, NetworkPort and SecurityGroup belong to a ResourceGroup #19343
Conversation
@mancabizjak do you need this PR to be merged first ? if so then mark this PR in title WIP :
EDIT: anyway thanks for the PRs :) |
@lpichler that's right. Done and thanks for the heads up, appreciated! |
With this commit we model a `belongs_to` relationship to a ResourceGroup for CloudNetwork, NetworkPort and SecurityGroup models. A ResourceGroup now has a `has_many` relationship to these network entities. This mirrors the existing relationship between ResourceGroup and VMs. When a resource group is deleted, references to the associated resources are nullified. Signed-off-by: Manca Bizjak <[email protected]>
03c9bd3
to
e9e72f7
Compare
Checked commit xlab-si@e9e72f7 with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 |
Thanks @mancabizjak ! |
In this commit we model a
belongs_to
relationship to aResourceGroup
forCloudNetwork
,NetworkPort
andSecurityGroup
. AResourceGroup
now has ahas_many
relationship to these network entities. This mirrors the existing relationship between theResourceGroup
and
Vm
s.Rationale
This change is relevant in the context of Azure and AzureStack providers.
It will allow us to intuitively infer related DB targets in the scope of targeted refresh for resource groups (an ongoing effort). Currently we can only do
resource_group.vms
, but to retrieve networks, network ports and security groups witin a specific resource group, we would have to use.where(ems_ref LIKE <resource_group.name>)
, since resource group name is a part of every AzureStack resource'sems_ref
.WIP
Links
@miq-bot add_label enhancement
@miq-bot assign @agrare