From 87fe0a102732304cb7996157a3c3e64cc41aa056 Mon Sep 17 00:00:00 2001 From: Eric Promislow Date: Fri, 28 Mar 2025 10:27:05 -0700 Subject: [PATCH 1/3] Add context to the remotedialer ping logger - steve side. --- pkg/aggregation/server.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/aggregation/server.go b/pkg/aggregation/server.go index b0b3a744..a75df58c 100644 --- a/pkg/aggregation/server.go +++ b/pkg/aggregation/server.go @@ -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() From e088793918bf524c3055d8bf6254897b65f22061 Mon Sep 17 00:00:00 2001 From: Eric Promislow Date: Fri, 28 Mar 2025 14:12:38 -0700 Subject: [PATCH 2/3] Use a custom type as a context key instead of a basic string --- go.mod | 1 + go.sum | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/go.mod b/go.mod index fca158e8..1d86cec3 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ replace ( github.com/crewjam/saml => github.com/rancher/saml v0.4.14 github.com/knative/pkg => github.com/rancher/pkg v0.0.0-20181214184433-b04c0947ad2f github.com/matryer/moq => github.com/rancher/moq v0.0.0-20190404221404-ee5226d43009 + github.com/rancher/remotedialer => ../remotedialer ) require ( diff --git a/go.sum b/go.sum index 64484df1..c14e2b1b 100644 --- a/go.sum +++ b/go.sum @@ -232,8 +232,6 @@ github.com/rancher/lasso v0.2.1 h1:SZTqMVQn8cAOqvwGBd1/EYOIJ/MGN+UfJrOWvHd4jHU= github.com/rancher/lasso v0.2.1/go.mod h1:KSV3jBXfdXqdCuMm2uC8kKB9q/wuDYb3h0eHZoRjShM= github.com/rancher/norman v0.6.0 h1:8CyY9cVcw0L+YYZRGvXHPMENefLaDkmi6vpscrVjXew= github.com/rancher/norman v0.6.0/go.mod h1:CQ0/1CoEqbeJXvOXuRQvsmiBd7QIgxZG5IvQFOPAHOg= -github.com/rancher/remotedialer v0.3.2 h1:kstZbRwPS5gPWpGg8VjEHT2poHtArs+Fc317YM8JCzU= -github.com/rancher/remotedialer v0.3.2/go.mod h1:Ys004RpJuTLSm+k4aYUCoFiOOad37ubYev3TkOFg/5w= github.com/rancher/wrangler/v3 v3.2.0-rc.3 h1:MySHWLxLLrGrM2sq5YYp7Ol1kQqYt9lvIzjGR50UZ+c= github.com/rancher/wrangler/v3 v3.2.0-rc.3/go.mod h1:0C5QyvSrQOff8gQQzpB/L/FF03EQycjR3unSJcKCHno= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= From 0e51f72c18a39eea1031040a0c25fcba0fe2894c Mon Sep 17 00:00:00 2001 From: Eric Promislow Date: Wed, 23 Apr 2025 10:32:44 -0700 Subject: [PATCH 3/3] Bump remotedialer so it can use the configured context. --- go.mod | 3 +-- go.sum | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 1d86cec3..8b9605b2 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,6 @@ replace ( github.com/crewjam/saml => github.com/rancher/saml v0.4.14 github.com/knative/pkg => github.com/rancher/pkg v0.0.0-20181214184433-b04c0947ad2f github.com/matryer/moq => github.com/rancher/moq v0.0.0-20190404221404-ee5226d43009 - github.com/rancher/remotedialer => ../remotedialer ) require ( @@ -26,7 +25,7 @@ require ( github.com/rancher/kubernetes-provider-detector v0.1.5 github.com/rancher/lasso v0.2.1 github.com/rancher/norman v0.6.0 - github.com/rancher/remotedialer v0.3.2 + github.com/rancher/remotedialer v0.4.5-rc.1 github.com/rancher/wrangler/v3 v3.2.0-rc.3 github.com/sirupsen/logrus v1.9.3 github.com/stretchr/testify v1.10.0 diff --git a/go.sum b/go.sum index c14e2b1b..d350020c 100644 --- a/go.sum +++ b/go.sum @@ -232,6 +232,8 @@ github.com/rancher/lasso v0.2.1 h1:SZTqMVQn8cAOqvwGBd1/EYOIJ/MGN+UfJrOWvHd4jHU= github.com/rancher/lasso v0.2.1/go.mod h1:KSV3jBXfdXqdCuMm2uC8kKB9q/wuDYb3h0eHZoRjShM= github.com/rancher/norman v0.6.0 h1:8CyY9cVcw0L+YYZRGvXHPMENefLaDkmi6vpscrVjXew= github.com/rancher/norman v0.6.0/go.mod h1:CQ0/1CoEqbeJXvOXuRQvsmiBd7QIgxZG5IvQFOPAHOg= +github.com/rancher/remotedialer v0.4.5-rc.1 h1:LwGrOqt6hrKjf9Er5LBEKP6xk21RFF7PO2d0+E+mavk= +github.com/rancher/remotedialer v0.4.5-rc.1/go.mod h1:x31ZR9714VzudfHVke40+WN5wDSDckxjRGr1bWgpgc0= github.com/rancher/wrangler/v3 v3.2.0-rc.3 h1:MySHWLxLLrGrM2sq5YYp7Ol1kQqYt9lvIzjGR50UZ+c= github.com/rancher/wrangler/v3 v3.2.0-rc.3/go.mod h1:0C5QyvSrQOff8gQQzpB/L/FF03EQycjR3unSJcKCHno= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=