Skip to content
This repository was archived by the owner on Mar 27, 2026. It is now read-only.

Commit 43fce5a

Browse files
committed
Revert PR #10 - instead log the error
1 parent 12d1f18 commit 43fce5a

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

api/remote/remote.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (r *Remote) Run(ctx context.Context) error {
4444
func(_ mqtt.Client, msg mqtt.Message) {
4545
payload := msg.Payload()
4646
if err := r.ReceiveHandler(payload); err != nil {
47-
log.Printf("MQTT ReceiveHandler failed for: %v", payload)
47+
log.Printf("MQTT ReceiveHandler failed: %w", err)
4848
}
4949
},
5050
)

main.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package main
33
import (
44
"context"
55
"encoding/binary"
6-
"errors"
76
"fmt"
87
"golang.org/x/sync/errgroup"
98
"log"
@@ -18,8 +17,6 @@ import (
1817

1918
"google.golang.org/protobuf/proto"
2019

21-
"github.com/vishvananda/netlink"
22-
2320
"github.com/datum-cloud/galactic-agent/api/local"
2421
"github.com/datum-cloud/galactic-agent/api/remote"
2522
"github.com/datum-cloud/galactic-agent/srv6"
@@ -139,11 +136,11 @@ func main() {
139136
switch kind.Route.Status {
140137
case remote.Route_ADD:
141138
if err := srv6.RouteEgressAdd(kind.Route.Network, kind.Route.Srv6Endpoint, kind.Route.Srv6Segments); err != nil {
142-
return IgnoreLinkNotFound(err)
139+
return err
143140
}
144141
case remote.Route_DELETE:
145142
if err := srv6.RouteEgressDel(kind.Route.Network, kind.Route.Srv6Endpoint, kind.Route.Srv6Segments); err != nil {
146-
return IgnoreLinkNotFound(err)
143+
return err
147144
}
148145
}
149146
}
@@ -196,11 +193,3 @@ func EncodeVPCToSRv6Endpoint(srv6_net, vpc, vpcAttachment string) (string, error
196193
binary.BigEndian.PutUint64(ip[8:16], (vpcInt<<16)|vpcAttachmentInt)
197194
return ip.String(), nil
198195
}
199-
200-
func IgnoreLinkNotFound(err error) error {
201-
var notFoundErr netlink.LinkNotFoundError
202-
if errors.As(err, &notFoundErr) {
203-
return nil
204-
}
205-
return err
206-
}

0 commit comments

Comments
 (0)