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

Fix call to get_targets_for_source to be correct scope name #16824

Merged

Conversation

d-m-u
Copy link
Contributor

@d-m-u d-m-u commented Jan 15, 2018

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

@d-m-u d-m-u changed the title Add method for cloud_tenant to cloud_network and fix call [WIP] Add method for cloud_tenant to cloud_network and fix call Jan 15, 2018
@d-m-u
Copy link
Contributor Author

d-m-u commented Jan 15, 2018

@miq-bot assign @gmcculloug
@miq-bot add_label provisioning
@syncrou I think this fixes our issue with openstack specs

@d-m-u d-m-u force-pushed the fixing_openstack_cloud_network_call branch 3 times, most recently from 5cc4de5 to 2929e96 Compare January 15, 2018 22:33
@@ -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')
Copy link
Member

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.

Copy link
Contributor

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

@d-m-u
Copy link
Contributor Author

d-m-u commented Jan 16, 2018

@miq-bot add_label gaprindashvili/yes

@d-m-u d-m-u changed the title Add method for cloud_tenant to cloud_network and fix call Fix call to get_targets_for_source to be correct scope name Jan 16, 2018
@d-m-u
Copy link
Contributor Author

d-m-u commented Jan 17, 2018

@Ladas @syncrou GM says "we can address the external repo tests as a follow up" so can we please get this reviewed ASAP?

Copy link
Contributor

@syncrou syncrou left a comment

Choose a reason for hiding this comment

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

👍 LGTM

@d-m-u
Copy link
Contributor Author

d-m-u commented Jan 18, 2018

@miq-bot add_label blocker

@miq-bot
Copy link
Member

miq-bot commented Jan 18, 2018

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
1 file checked, 0 offenses detected
Everything looks fine. 🍪

@d-m-u
Copy link
Contributor Author

d-m-u commented Jan 18, 2018

@syncrou @gmcculloug can you two please give this (hopefully) a final look?

Copy link
Contributor

@Ladas Ladas left a comment

Choose a reason for hiding this comment

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

Looks good 👍

Copy link
Contributor

@syncrou syncrou left a comment

Choose a reason for hiding this comment

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

👍 Looks gooder

@gmcculloug
Copy link
Member

@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 allowed_ci and pass a RBAC filtered list so all providers honor RBAC restrictions. Then the providers that do not support the subnet <- availability_zone relationships can override the availability_zone_to_cloud_network method to return the full set.

In the future when that relationship is supported the external repos can remove this override logic and use the base class method.

Thoughts?

@Ladas
Copy link
Contributor

Ladas commented Jan 19, 2018

@gmcculloug yeah, overriding availability_zone_to_cloud_network to return full set in google and openstack sounds good.

@gmcculloug gmcculloug merged commit f5f9a83 into ManageIQ:master Jan 19, 2018
@gmcculloug gmcculloug added this to the Sprint 78 Ending Jan 29, 2018 milestone Jan 19, 2018
@d-m-u d-m-u deleted the fixing_openstack_cloud_network_call branch January 19, 2018 14:03
simaishi pushed a commit that referenced this pull request Jan 19, 2018
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
@simaishi
Copy link
Contributor

Gaprindashvili backport details:

$ git log -1
commit 345484871740c733b99443012e028043f0605a7c
Author: Greg McCullough <gmccullo@redhat.com>
Date:   Fri Jan 19 08:57:57 2018 -0500

    Merge pull request #16824 from d-m-u/fixing_openstack_cloud_network_call
    
    Fix call to get_targets_for_source to be correct scope name
    (cherry picked from commit f5f9a83a1bf7bbb0e66344f5dd30c5922d569d42)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1536509

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants