Skip to content

Staskraev/l3 agent scheduler#2501

Merged
mandre merged 7 commits intogophercloud:masterfrom
catalyst-cloud:staskraev/l3-agent-scheduler
Nov 14, 2022
Merged

Staskraev/l3 agent scheduler#2501
mandre merged 7 commits intogophercloud:masterfrom
catalyst-cloud:staskraev/l3-agent-scheduler

Conversation

@flashvoid
Copy link
Copy Markdown
Contributor

@flashvoid flashvoid commented Oct 31, 2022

Fixes #2500

Links to the line numbers/files in the OpenStack source code that support the
code in this PR:

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for submitting your first PR! Be sure that we will be looking at it but keep in mind
this sometimes takes a while.
Please let the maintainers know if your PR has not got enough attention after a few days.
If any doubt, please consult our PR tutorial.

@flashvoid flashvoid changed the title [wip] Staskraev/l3 agent scheduler Staskraev/l3 agent scheduler Nov 1, 2022
Copy link
Copy Markdown
Contributor

@mandre mandre left a comment

Choose a reason for hiding this comment

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

Nice, thanks a lot for the PR. It looks good to me in general. I've left a couple of comments. This is almost good to merge.


agentID := "0e1095ae-6f36-40f3-8322-8e1c9a5e68ca"
routerID := "e6fa0457-efc2-491d-ac12-17ab60417efd"
err = agents.RemoveL3Router(neutron, "0e1095ae-6f36-40f3-8322-8e1c9a5e68ca", "e6fa0457-efc2-491d-ac12-17ab60417efd").ExtractErr()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Was the intention of defining the agentID and routerID variables to use them here?

Suggested change
err = agents.RemoveL3Router(neutron, "0e1095ae-6f36-40f3-8322-8e1c9a5e68ca", "e6fa0457-efc2-491d-ac12-17ab60417efd").ExtractErr()
err = agents.RemoveL3Router(neutron, agentID, routerID).ExtractErr()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, thanks


agentID := "0e1095ae-6f36-40f3-8322-8e1c9a5e68ca"
routerID := "e6fa0457-efc2-491d-ac12-17ab60417efd"
err = agents.ScheduleL3Router(neutron, agentID, agents.ScheduleL3RouterOpts{routerID}).ExtractErr()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Better to be explicit:

Suggested change
err = agents.ScheduleL3Router(neutron, agentID, agents.ScheduleL3RouterOpts{routerID}).ExtractErr()
err = agents.ScheduleL3Router(neutron, agentID, agents.ScheduleL3RouterOpts{RouterID: routerID}).ExtractErr()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

right


func listL3RoutersURL(c *gophercloud.ServiceClient, id string) string {
// TODO
// hmm list should be the plain l3RoutersURL but dhcp example tell otherwise
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Leftover comment?

Both listL3RoutersURL and listDHCPNetworksURL look good to me. What was the issue?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

leftover from original research

th.AssertNoErr(t, err)
hostingAgents, err := routers.ExtractL3Agents(allPages)
th.AssertNoErr(t, err)
th.AssertEquals(t, len(hostingAgents) > 0, true)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There's a AssertIntGreaterOrEqual() helper function you could use for comparing values.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@coveralls
Copy link
Copy Markdown

coveralls commented Nov 11, 2022

Coverage Status

Coverage increased (+0.02%) to 80.054% when pulling 918cd83 on catalyst-cloud:staskraev/l3-agent-scheduler into 0226ea5 on gophercloud:master.

@flashvoid flashvoid requested a review from mandre November 11, 2022 06:19
Copy link
Copy Markdown
Contributor

@mandre mandre left a comment

Choose a reason for hiding this comment

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

Just an off by 1 error to fix, then I think it's ready to merge. Thanks.

Co-authored-by: Martin André <martin.andre@gmail.com>
Copy link
Copy Markdown
Contributor

@mandre mandre left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@mandre mandre merged commit 92af431 into gophercloud:master Nov 14, 2022
@pierreprinetti pierreprinetti added this to the v1.1.0 milestone Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

L3 router scheduling API

4 participants