-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add support to list PER enabled DCs/Zones #542
Add support to list PER enabled DCs/Zones #542
Conversation
f983290
to
ef43fbc
Compare
ef43fbc
to
7d8d9ff
Compare
/cc @dharaneeshvrd |
2e2bc00
to
7fa403c
Compare
for _, datacenter := range ret.Datacenters { | ||
if datacenter.Capabilities[powerEdgeRouter] { | ||
perEnabledRegions = append(perEnabledRegions, *datacenter.Location.Region) | ||
if pvmclient.Zone == *datacenter.Location.Region { |
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.
Instead of checking here, once perEnabledRegions
is populated, you can check outside the for loop only once.
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.
The current design will avoid an additional round of iteration on perEnabledRegions
as the membership is validated within the same loop. Hope this is ok.
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.
yes understood, I think the current code looks good to me!
} else { | ||
klog.Infof("%s, where the current instance is present supports PER.", pvmclient.Zone) | ||
} | ||
sort.Strings(perEnabledRegions) |
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.
Any reason behind the sorting?
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.
Just for improved readability, where datacenters of the same region stay grouped. 🙂
dal10 eu-de-1 eu-de-2 mad02 mad04 sao04 wdc06 wdc07
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kishen-v, mkumatag The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes: #519
Changes in this PR: