-
Notifications
You must be signed in to change notification settings - Fork 900
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
Fix call to get_targets_for_source to be correct scope name #16824
Fix call to get_targets_for_source to be correct scope name #16824
Conversation
@miq-bot assign @gmcculloug |
5cc4de5
to
2929e96
Compare
@@ -27,7 +27,7 @@ def allowed_cloud_subnets(_options = {}) | |||
|
|||
def allowed_cloud_networks(_options = {}) | |||
return {} unless (src = provider_or_tenant_object) | |||
targets = get_targets_for_source(src, :cloud_filter, CloudNetwork, 'cloud_networks') | |||
targets = get_targets_for_source(src, :cloud_filter, CloudNetwork, 'all_cloud_networks') |
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.
@Ladas This should resolve the issue of returning shared cloud_networks when only the provider or tenant are known. Can you provide some guidance (or recommend someone) for what to do when an availability_zone
has been selected in the provisioning UI?
Do we have a way to determine what shared cloud_networks are available then? See the availability_zone_to_cloud_network method below which will be called from the allowed_ci
method to limit the cloud_networks.
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.
Cool, I've missed this one.
So looking at miq_provision dialogs, for Google and OpenStack, we can select AvailabilityZone when provisioning, but we do not refresh subnet <- availability_zone relationships. That means we need to disable allowed_ci for them for now (and put into todo list to check if the relation should be there).
For Vcloud, I am not sure, since I don't see provision dialog for it, but we refresh AZ without the relation to subnet.
So answer to Do we have a way to determine what shared cloud_networks are available then?
is no. We need to offer all networks, until we can refresh the subnet <- availability_zone relationships in these providers.
Azure and Amazon should work ok with allowed_ci filtering.
That being said, allowed_ci
filter is new here, so I think we should do manual test, for each provider, just for sure. And probably add small spec to each provider, something like https://github.com/Ladas/manageiq-providers-openstack/blob/bd5b69a68cf29f41a582d377a544597423586068/spec/models/manageiq/providers/openstack/cloud_manager/provision_workflow_spec.rb#L298
@miq-bot add_label gaprindashvili/yes |
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.
👍 LGTM
@miq-bot add_label blocker |
2929e96
to
3eb218e
Compare
Checked commit d-m-u@3eb218e with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0 |
@syncrou @gmcculloug can you two please give this (hopefully) a final look? |
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.
Looks good 👍
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.
👍 Looks gooder
@Ladas After reviewing your comments and the PRs made so far I think this PR, along with the related provider PRs (ManageIQ/manageiq-providers-openstack#202 and ManageIQ/manageiq-providers-google#43), get us closer to the correct solution. Now the cloud_workflow can still call In the future when that relationship is supported the external repos can remove this override logic and use the base class method. Thoughts? |
@gmcculloug yeah, overriding |
Fix call to get_targets_for_source to be correct scope name (cherry picked from commit f5f9a83) https://bugzilla.redhat.com/show_bug.cgi?id=1536509
Gaprindashvili backport details:
|
PR #16811 and #16688 broke openstack provisioning because the call needs the all_cloud_networks which was taken out in #16688. The all_cloud_networks includes the shared networks set up in the openstack provider specs here.
Fixes issue caused by fix of https://bugzilla.redhat.com/show_bug.cgi?id=1533277
(Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1535189)
Related to:
ManageIQ/manageiq-providers-openstack#202
ManageIQ/manageiq-providers-google#43
related external provider tests:
(which, since this and the above two are blockers, should maybe wait until the code is merged?)
ManageIQ/manageiq-providers-amazon#394
ManageIQ/manageiq-providers-azure#199