- Notifications
You must be signed in to change notification settings - Fork907
chore(vpn): send info, debug logs over tunnel#18240
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -65,7 +65,6 @@ func (r *RootCmd) vpnDaemonRun() *serpent.Command { | ||
logger.Info(ctx,"starting tunnel") | ||
tunnel,err:=vpn.NewTunnel(ctx,logger,pipe,vpn.NewClient(), | ||
vpn.UseOSNetworkingStack(), | ||
MemberAuthor
| ||
vpn.UseCustomLogSinks(sinks...), | ||
) | ||
iferr!=nil { | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -46,9 +46,6 @@ type Tunnel struct { | ||
logger slog.Logger | ||
Comment on lines -49 to -50 MemberAuthor
| ||
client Client | ||
// clientLogger is a separate logger than `logger` when the `UseAsLogger` | ||
@@ -300,29 +297,22 @@ func (t *Tunnel) stop(*StopRequest) error { | ||
var _ slog.Sink = &Tunnel{} | ||
func (t *Tunnel) LogEntry(_ context.Context, e slog.SinkEntry) { | ||
msg := &TunnelMessage{ | ||
Msg: &TunnelMessage_Log{ | ||
Log: sinkEntryToPb(e), | ||
}, | ||
} | ||
select { | ||
case <-t.updater.ctx.Done(): | ||
return | ||
case <-t.ctx.Done(): | ||
return | ||
case t.sendCh <- msg: | ||
Comment on lines +305 to +310 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. We deliberately never cancel the tunnel ctx, due to the somewhat precarious teardown procedure. We do however cancel the updater ctx to ensure we don't tick network updates after shutdown, so we'll check for that here too. | ||
} | ||
} | ||
func (*Tunnel) Sync() {} | ||
func sinkEntryToPb(e slog.SinkEntry) *Log { | ||
l := &Log{ | ||
// #nosec G115 - Safe conversion for log levels which are small positive integers | ||
@@ -583,6 +573,8 @@ func (u *updater) sendAgentUpdate() { | ||
return | ||
} | ||
u.logger.Debug(u.ctx, "sending agent update") | ||
msg := &TunnelMessage{ | ||
Msg: &TunnelMessage_PeerUpdate{ | ||
PeerUpdate: &PeerUpdate{ | ||
Uh oh!
There was an error while loading.Please reload this page.