Repository navigation
Enable BGP next-hop-self #666
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -130,7 +130,7 @@ const ( | |
| ) | ||
|
|
||
| // BgpActions defines BGP-specific actions for a policy statement. | ||
| // +kubebuilder:validation:XValidation:rule="has(self.setCommunity) || has(self.setExtCommunity) || has(self.setASPath)",message="at least one BGP action must be specified" | ||
| // +kubebuilder:validation:XValidation:rule="has(self.setCommunity) || has(self.setExtCommunity) || has(self.setASPath) || has(self.setNextHop)",message="at least one BGP action must be specified" | ||
| type BgpActions struct { | ||
| // SetCommunity configures BGP standard community attributes. | ||
| // +optional | ||
|
|
@@ -143,6 +143,17 @@ type BgpActions struct { | |
| // SetASPath configures modifications to the BGP AS path attribute. | ||
| // +optional | ||
| SetASPath *SetASPathAction `json:"setASPath,omitempty"` | ||
|
|
||
| // SetNextHop configures the BGP next-hop for advertised routes. | ||
| // +optional | ||
| SetNextHop *SetNextHopAction `json:"setNextHop,omitempty"` | ||
| } | ||
|
|
||
| // SetNextHopAction defines how to replace the BGP next-hop for advertised routes. | ||
| type SetNextHopAction struct { | ||
| // IPAddr specifies the next-hop IP address to set for advertised routes. | ||
| // +required | ||
| IPAddr IPAddr `json:"ipAddr"` | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't use abbreviations. ref/ https://github.com/kubernetes/community/blob/main/contributors/devel/sig-architecture/api-conventions.md#naming-conventions Given we already use just the word "Address" in many places. I'd favor just that. |
||
| } | ||
|
|
||
| // SetASPathAction defines actions to modify the BGP AS path attribute. | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,6 +71,15 @@ var _ = Describe("BGPPeer Controller", func() { | |
| g.Expect(list.Items).To(BeEmpty()) | ||
| }).Should(Succeed()) | ||
|
|
||
| By("Cleaning up RoutingPolicy resources for this device") | ||
| policyList := &v1alpha1.RoutingPolicyList{} | ||
| Expect(k8sClient.List(ctx, policyList, client.InNamespace(metav1.NamespaceDefault))).To(Succeed()) | ||
| for i := range policyList.Items { | ||
| if policyList.Items[i].Spec.DeviceRef.Name == device.Name { | ||
| Expect(client.IgnoreNotFound(k8sClient.Delete(ctx, &policyList.Items[i]))).To(Succeed()) | ||
|
Comment on lines
+78
to
+79
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should be able to use a IndexField for this which we setup on all resources based on the referenced device. |
||
| } | ||
| } | ||
|
|
||
| By("Cleaning up Interface resources for this device") | ||
| intfList := &v1alpha1.InterfaceList{} | ||
| Expect(k8sManager.GetClient().List(ctx, intfList, client.InNamespace(metav1.NamespaceDefault), client.MatchingFields{v1alpha1.DeviceRefIndexKey: device.Name})).To(Succeed()) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.