Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[networking]: add BGP VPNs support #3078

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

Merged
merged 1 commit into from
Jul 3, 2024
Merged

Conversation

@github-actions github-actions bot added the semver:minor Backwards-compatible change label Jul 1, 2024
@github-actions github-actions bot added semver:minor Backwards-compatible change and removed semver:minor Backwards-compatible change labels Jul 1, 2024
@github-actions github-actions bot added semver:minor Backwards-compatible change and removed semver:minor Backwards-compatible change labels Jul 1, 2024
@github-actions github-actions bot added semver:minor Backwards-compatible change and removed semver:minor Backwards-compatible change labels Jul 1, 2024
@coveralls
Copy link

Coverage Status

coverage: 78.737% (+0.06%) from 78.682%
when pulling 86bdd04 on kayrus:bgpvpns
into c037440 on gophercloud:master.

@coveralls
Copy link

Coverage Status

coverage: 78.737% (+0.06%) from 78.682%
when pulling a05dec3 on kayrus:bgpvpns
into c037440 on gophercloud:master.

@coveralls
Copy link

Coverage Status

coverage: 78.737% (+0.06%) from 78.682%
when pulling 84ec58e on kayrus:bgpvpns
into c037440 on gophercloud:master.

@github-actions github-actions bot added semver:minor Backwards-compatible change and removed semver:minor Backwards-compatible change labels Jul 2, 2024
@coveralls
Copy link

Coverage Status

coverage: 78.737% (+0.06%) from 78.682%
when pulling 9c28860 on kayrus:bgpvpns
into c037440 on gophercloud:master.

@github-actions github-actions bot added semver:minor Backwards-compatible change and removed semver:minor Backwards-compatible change labels Jul 2, 2024
@coveralls
Copy link

Coverage Status

coverage: 78.737% (+0.06%) from 78.682%
when pulling bd323c4 on kayrus:bgpvpns
into c037440 on gophercloud:master.

@github-actions github-actions bot added semver:minor Backwards-compatible change and removed semver:minor Backwards-compatible change labels Jul 2, 2024
@coveralls
Copy link

Coverage Status

coverage: 78.737% (+0.06%) from 78.682%
when pulling 94fa3d1 on kayrus:bgpvpns
into c037440 on gophercloud:master.

@github-actions github-actions bot added semver:minor Backwards-compatible change and removed semver:minor Backwards-compatible change labels Jul 2, 2024
@coveralls
Copy link

Coverage Status

coverage: 78.737% (+0.06%) from 78.682%
when pulling 653117d on kayrus:bgpvpns
into c037440 on gophercloud:master.

@github-actions github-actions bot added semver:minor Backwards-compatible change and removed semver:minor Backwards-compatible change labels Jul 2, 2024
@coveralls
Copy link

Coverage Status

coverage: 78.737% (+0.06%) from 78.682%
when pulling 6a8fdba on kayrus:bgpvpns
into c037440 on gophercloud:master.

@coveralls
Copy link

Coverage Status

coverage: 78.737% (+0.06%) from 78.682%
when pulling 1f0632a on kayrus:bgpvpns
into c037440 on gophercloud:master.

@kayrus
Copy link
Contributor Author

kayrus commented Jul 2, 2024

I don't know what can we do with the TestBGPAgentRUD tests timeouts.

@github-actions github-actions bot added semver:minor Backwards-compatible change and removed semver:minor Backwards-compatible change labels Jul 2, 2024
@coveralls
Copy link

Coverage Status

coverage: 78.737% (+0.06%) from 78.682%
when pulling 9c1d6af on kayrus:bgpvpns
into 0dae567 on gophercloud:master.

EmilienM
EmilienM previously approved these changes Jul 2, 2024
@github-actions github-actions bot added semver:minor Backwards-compatible change and removed semver:minor Backwards-compatible change labels Jul 2, 2024
@coveralls
Copy link

Coverage Status

coverage: 78.737% (+0.06%) from 78.682%
when pulling 02c2dad on kayrus:bgpvpns
into 0dae567 on gophercloud:master.

@kayrus kayrus requested a review from EmilienM July 3, 2024 09:51
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.

A few questions, mostly around doc inconsistency which I can get an answer by looking at the code. I'll be doing that now.

type ListOpts struct {
Fields []string `q:"fields"`
ProjectID string `q:"project_id"`
Networks []string `q:"networks"`
Copy link
Contributor

Choose a reason for hiding this comment

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

According to the doc, the networks, routers, and ports are arrays. Do you know how they should be represented in the query? Are they repeated like fields is, or should we use a different format, such as comma-separated?

Copy link
Contributor Author

@kayrus kayrus Jul 3, 2024

Choose a reason for hiding this comment

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

It should be this way: ?fields=name&fields=id&networks=UUID1&networks=UUID2
The response should return name and id of the resources, which correspond to networks=UUID1 or networks=UUID2 filter.

return
}
resp, err := c.Put(ctx, updateURL(c, id), b, &r.Body, &gophercloud.RequestOpts{
OkCodes: []int{200},
Copy link
Contributor

Choose a reason for hiding this comment

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

Doc says we're expecting 201 on success, can we double check this is correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

201 is not returned. You can confirm this in functional tests.

// router association.
type CreateRouterAssociationOpts struct {
RouterID string `json:"router_id" required:"true"`
AdvertiseExtraRoutes *bool `json:"advertise_extra_routes,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's documented in PUT method. I've just checked whether project_id can be set as well for cases, when admins need to create a resource. I'll add this option as well. Otherwise cloud admins will get Request forbidden: [POST https://network-3.qa-de-1.cloud.sap/v2.0/bgpvpn/bgpvpns/920b4f41-6553-4ec5-ad87-f3bf156a7650/router_associations], error message: {"NeutronError": {"type": "NotAuthorized", "message": "Not authorized.", "detail": ""}}

return
}
resp, err := client.Put(ctx, updatePortAssociationURL(client, bgpVpnID, id), b, &r.Body, &gophercloud.RequestOpts{
OkCodes: []int{200},
Copy link
Contributor

Choose a reason for hiding this comment

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

Here too, doc says the successful http code is 201. Which is correct?

Copy link
Contributor Author

@kayrus kayrus Jul 3, 2024

Choose a reason for hiding this comment

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

The correct is the one, which is returned by API and passes functional tests :)

Type string `json:"type"`

// Indicates whether this BGP VPN is shared across tenants.
Shared bool `json:"shared"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a read-only field. It's set to true, when rbac rules are used.


// The default BGP LOCAL_PREF of routes that will be advertised to the
// BGPVPN (unless overridden per-route).
LocalPref *int `json:"local_pref"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is it a pointer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because we need to have an ability to set it to 0 on update.

type PortAssociation struct {
ID string `json:"id"`
PortID string `json:"port_id"`
TenantID string `json:"tenant_id"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

API returns these attributes.

}
bgpVpnUpdated, err := bgpvpns.Update(context.TODO(), client, bgpVpnGot.ID, updateBGPOpts).Extract()
th.AssertNoErr(t, err)
th.AssertEquals(t, bgpVpnUpdated.Name, newBGPVPNName)
Copy link
Contributor

Choose a reason for hiding this comment

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

The arguments should be reversed. It's expected, actual.

Copy link
Contributor

Choose a reason for hiding this comment

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

You have the same issue in a few places.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true, I always mix them up. Will fix soon.

@github-actions github-actions bot removed the semver:minor Backwards-compatible change label Jul 3, 2024
@kayrus
Copy link
Contributor Author

kayrus commented Jul 3, 2024

@mandre addressed all your comments.

@github-actions github-actions bot added the semver:minor Backwards-compatible change label Jul 3, 2024
@coveralls
Copy link

Coverage Status

coverage: 78.737% (+0.06%) from 78.682%
when pulling f07b68b on kayrus:bgpvpns
into 0dae567 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.

This looks good, thanks. Let's just wait for the CI to return before merging.

@kayrus
Copy link
Contributor Author

kayrus commented Jul 3, 2024

@mandre thanks, merging

@kayrus kayrus merged commit bbf380a into gophercloud:master Jul 3, 2024
16 checks passed
@kayrus kayrus deleted the bgpvpns branch July 3, 2024 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:minor Backwards-compatible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Neutron V2: BGP VPNs
4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.