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

chore: add few logs #113

Merged
merged 1 commit into from
Aug 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/evpn/vrf.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
tableID := uint32(1000 + math.Mod(float64(in.Vrf.Spec.Vni), 10.0))
// Example: ip link add blue type vrf table 1000
vrf := &netlink.Vrf{LinkAttrs: netlink.LinkAttrs{Name: vrfName}, Table: tableID}
log.Printf("Creating VRF %v", vrf)

Check warning on line 62 in pkg/evpn/vrf.go

View check run for this annotation

Codecov / codecov/patch

pkg/evpn/vrf.go#L62

Added line #L62 was not covered by tests
if err := netlink.LinkAdd(vrf); err != nil {
fmt.Printf("Failed to create VRF link: %v", err)
return nil, err
Expand Down Expand Up @@ -94,6 +94,7 @@
// Example: ip link add br100 type bridge
bridgeName := fmt.Sprintf("br%d", in.Vrf.Spec.Vni)
bridge := &netlink.Bridge{LinkAttrs: netlink.LinkAttrs{Name: bridgeName}}
log.Printf("Creating Linux Bridge %v", bridge)

Check warning on line 97 in pkg/evpn/vrf.go

View check run for this annotation

Codecov / codecov/patch

pkg/evpn/vrf.go#L97

Added line #L97 was not covered by tests
if err := netlink.LinkAdd(bridge); err != nil {
fmt.Printf("Failed to create Bridge link: %v", err)
return nil, err
Expand All @@ -119,6 +120,7 @@
binary.BigEndian.PutUint32(myip, in.Vrf.Spec.VtepIpPrefix.Addr.GetV4Addr())
// TODO: take Port from proto instead of hard-coded
vxlan := &netlink.Vxlan{LinkAttrs: netlink.LinkAttrs{Name: vxlanName}, VxlanId: int(in.Vrf.Spec.Vni), Port: 4789, Learning: false, SrcAddr: myip}
log.Printf("Creating VXLAN %v", vxlan)

Check warning on line 123 in pkg/evpn/vrf.go

View check run for this annotation

Codecov / codecov/patch

pkg/evpn/vrf.go#L123

Added line #L123 was not covered by tests
if err := netlink.LinkAdd(vxlan); err != nil {
fmt.Printf("Failed to create Vxlan link: %v", err)
return nil, err
Expand Down Expand Up @@ -167,7 +169,7 @@
resourceID := path.Base(obj.Name)
// use netlink to find VRF
vrf, err := netlink.LinkByName(resourceID)
log.Printf("Deleting VRF %v", vrf)

Check warning on line 172 in pkg/evpn/vrf.go

View check run for this annotation

Codecov / codecov/patch

pkg/evpn/vrf.go#L172

Added line #L172 was not covered by tests
if err != nil {
err := status.Errorf(codes.NotFound, "unable to find key %s", resourceID)
log.Printf("error: %v", err)
Expand Down
Loading