Skip to content

Commit

Permalink
add logs to waitForPeerUp function (#848)
Browse files Browse the repository at this point in the history
Signed-off-by: NikitaSkrynnik <[email protected]>
  • Loading branch information
NikitaSkrynnik authored Aug 22, 2024
1 parent a7b2adb commit c77c50e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/networkservice/up/peerup/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ func waitForPeerUp(ctx context.Context, vppConn api.Connection, pubKey string, i
for {
select {
case <-ctx.Done():
log.FromContext(ctx).Infof("failed to get any WireguardPeerEvents: %s", ctx.Err())
return errors.Wrap(ctx.Err(), "provided context is done")
case rawMsg := <-watcher.Events():
log.FromContext(ctx).Infof("got WireguardPeerEvent: %v, %v", rawMsg.GetMessageName(), rawMsg.GetMessageType())
if msg, ok := rawMsg.(*wireguard.WireguardPeerEvent); ok &&
msg.PeerIndex == peerIndex &&
msg.Flags&wireguard.WIREGUARD_PEER_ESTABLISHED != 0 {
Expand Down

0 comments on commit c77c50e

Please sign in to comment.