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

Remove region support #52

Merged
merged 1 commit into from
Mar 6, 2018
Merged

Conversation

tumido
Copy link
Member

@tumido tumido commented Mar 2, 2018

Remove regions completely from GCE for now. They were used only for ems descriptions - incorrectly, since the provider operates across regions.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1433062
Related: ManageIQ/manageiq#17088

@miq-bot add_label bug, gaprindashvili/yes, refactoring

@bronaghs
Copy link

bronaghs commented Mar 2, 2018

Looks like there are some specs around regions here:

it "moves the network_manager to the same zone and provider region as the cloud_manager" do

@@ -16,7 +16,6 @@ class ManageIQ::Providers::Google::CloudManager < ManageIQ::Providers::CloudMana
include ManageIQ::Providers::Google::ManagerMixin

supports :provisioning
supports :regions

before_create :ensure_managers
before_update :ensure_managers_zone_and_provider_region
Copy link

Choose a reason for hiding this comment

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

@tumido - is this needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

@bronaghs Why should we keep it there? GCE has currently no usecase for regions at all.

Copy link

Choose a reason for hiding this comment

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

Im referring to line 21, Im implying it looks like it isnt.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, I see, sorry.

Well, this will keep the manager zones in sync and I assume we want that. Also as a sideeffect it would sync the provider_region, sure. Though if it's already nil, it's nil for both managers and nothing really happens.

The other way would be to define a new before_update rule, which would sync only the zone. And also new before_create rule, since :ensure_managers uses :ensure_managers_zone_and_provider_region internally. I just thing leaving it there is harmless. What do you think?

Copy link

Choose a reason for hiding this comment

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

@tumido - Given that these methods have such short implementations, I think it would be worthwhile to override them to keep things clean.

@tumido
Copy link
Member Author

tumido commented Mar 2, 2018

Ok, the spec is pointless (the region part). GCE spans across all regions so there's no point in placing it in one region specifically and checking if it works. It does work, cause there's a restriction for it, but such change has no real impact on provider. I'll remove that from the spec, thanks for pointing that out 👍

@bronaghs
Copy link

bronaghs commented Mar 2, 2018

Looks like region should be removed from here:

@ems = FactoryGirl.create(:ems_google, :zone => zone, :provider_region => "us-central1")

@tumido
Copy link
Member Author

tumido commented Mar 2, 2018

Good catch with the Factory, I'll remove that. I'll also remove it from core factories at:

Sounds good?

@bronaghs
Copy link

bronaghs commented Mar 5, 2018

sounds good @tumido

@miq-bot
Copy link
Member

miq-bot commented Mar 6, 2018

Checked commit tumido@630418c with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
4 files checked, 0 offenses detected
Everything looks fine. 🏆

@juliancheal
Copy link
Member

LGTM 👍

@bronaghs bronaghs merged commit e91c9f6 into ManageIQ:master Mar 6, 2018
@bronaghs bronaghs added this to the Sprint 81 Ending Mar 12, 2018 milestone Mar 6, 2018
simaishi pushed a commit that referenced this pull request Mar 6, 2018
@simaishi
Copy link
Contributor

simaishi commented Mar 6, 2018

Gaprindashvili backport details:

$ git log -1
commit f270e0ea449b5bedee905f85d07fc08f220ef3b0
Author: Bronagh Sorota <bsorota@redhat.com>
Date:   Tue Mar 6 10:44:13 2018 -0500

    Merge pull request #52 from tumido/remove_regions_from_ems
    
    Remove region support
    (cherry picked from commit e91c9f6be0f33496d03646df2fe9b1aa8460ec53)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1552305

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.

None yet

5 participants