Skip to content

Commit

Permalink
Some linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
chdxD1 committed Dec 20, 2023
1 parent a13792f commit 5774cb7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
5 changes: 3 additions & 2 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,9 @@ func setupReconcilers(mgr manager.Manager, anycastTracker *anycast.Tracker) erro
}

if err = (&controllers.RoutingTableReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Reconciler: r,
}).SetupWithManager(mgr); err != nil {
return fmt.Errorf("unable to create RoutingTable controller: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/nl/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (n *NetlinkManager) ListL2() ([]Layer2Information, error) {
return infos, nil
}

func (n *NetlinkManager) ListTaas() ([]TaasInformation, error) {
func (*NetlinkManager) ListTaas() ([]TaasInformation, error) {
infos := []TaasInformation{}

links, err := netlink.LinkList()
Expand Down
12 changes: 9 additions & 3 deletions pkg/nl/taas.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package nl

import "fmt"

type TaasInformation struct {
Name string
Table int
Expand All @@ -8,18 +10,22 @@ type TaasInformation struct {
func (n *NetlinkManager) CreateTaas(info TaasInformation) error {
_, err := n.createVRF(taasVrfPrefix+info.Name, info.Table)
if err != nil {
return err
return fmt.Errorf("error creating VRF for TaaS: %w", err)
}

err = n.setUp(taasVrfPrefix + info.Name)
if err != nil {
return err
return fmt.Errorf("error set VRF up for TaaS: %w", err)
}

return nil
}

func (n *NetlinkManager) CleanupTaas(info TaasInformation) error {
err := n.deleteLink(taasVrfPrefix + info.Name)
return err
if err != nil {
return fmt.Errorf("error deleting VRF for TaaS: %w", err)
}

return nil
}
4 changes: 2 additions & 2 deletions pkg/reconciler/layer3.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (r *reconcile) reconcileLayer3(l3vnis []networkv1alpha1.VRFRouteConfigurati
return err
}

vrfFromTaas, err := r.createVrfFromTaaS(taas)
vrfFromTaas, err := createVrfFromTaaS(taas)
if err != nil {
return err
}
Expand Down Expand Up @@ -155,7 +155,7 @@ func (r *reconcile) createVrfConfigMap(l3vnis []networkv1alpha1.VRFRouteConfigur
return vrfConfigMap, nil
}

func (r *reconcile) createVrfFromTaaS(taas []networkv1alpha1.RoutingTable) (map[string]frr.VRFConfiguration, error) {
func createVrfFromTaaS(taas []networkv1alpha1.RoutingTable) (map[string]frr.VRFConfiguration, error) {
vrfConfigMap := map[string]frr.VRFConfiguration{}

for i := range taas {
Expand Down

0 comments on commit 5774cb7

Please sign in to comment.