1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-10 20:00:23 +00:00

Add context to the remotedialer ping logger - steve side. (#577)

* Add context to the remotedialer ping logger - steve side.

* Use a custom type as a context key instead of a basic string

* Bump remotedialer so it can use the configured context.
This commit is contained in:
Eric Promislow
2025-04-29 11:24:31 -07:00
committed by GitHub
parent 57ce685118
commit e3b881f13a
3 changed files with 5 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"crypto/tls"
"crypto/x509"
"fmt"
"net"
"net/http"
"strings"
@@ -72,6 +73,7 @@ func serve(ctx context.Context, dialer websocket.Dialer, url string, headers htt
return err
}
defer conn.Close()
ctx = context.WithValue(ctx, remotedialer.ContextKeyCaller, fmt.Sprintf("steve server: url:%s", url))
go func() {
<-ctx.Done()