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

Staskraev/l3 agent scheduler #2501

Merged

Conversation

flashvoid
Copy link
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

@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
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
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
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
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
Contributor Author

Choose a reason for hiding this comment

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

right

func listDHCPNetworksURL(c *gophercloud.ServiceClient, id string) string {
return dhcpNetworksURL(c, id)
}

func listL3RoutersURL(c *gophercloud.ServiceClient, id string) string {
// TODO
// hmm list should be the plain l3RoutersURL but dhcp example tell otherwise
Copy link
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
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
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
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

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.

Copy link
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
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