mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-27 11:41:14 +00:00
cmd/k8s-operator: send operator logs to tailscale (#17110)
This commit modifies the k8s operator to wrap its logger using the logtail logger provided via the tsnet server. This causes any logs written by the operator to make their way to Tailscale in the same fashion as wireguard logs to be used by support. This functionality can also be opted-out of entirely using the "TS_NO_LOGS_NO_SUPPORT" environment variable. Updates https://github.com/tailscale/corp/issues/32037 Signed-off-by: David Bond <davidsbond93@gmail.com>
This commit is contained in:
@@ -495,14 +495,14 @@ func (s *Server) TailscaleIPs() (ip4, ip6 netip.Addr) {
|
||||
return ip4, ip6
|
||||
}
|
||||
|
||||
// Logtailf returns a [logger.Logf] that outputs to Tailscale's logging service and will be only visible to Tailscale's
|
||||
// LogtailWriter returns an [io.Writer] that writes to Tailscale's logging service and will be only visible to Tailscale's
|
||||
// support team. Logs written there cannot be retrieved by the user. This method always returns a non-nil value.
|
||||
func (s *Server) Logtailf() logger.Logf {
|
||||
func (s *Server) LogtailWriter() io.Writer {
|
||||
if s.logtail == nil {
|
||||
return logger.Discard
|
||||
return io.Discard
|
||||
}
|
||||
|
||||
return s.logtail.Logf
|
||||
return s.logtail
|
||||
}
|
||||
|
||||
func (s *Server) getAuthKey() string {
|
||||
|
||||
Reference in New Issue
Block a user