Add context to agent token validation error

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit c11c06cad4)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
pull/12044/head
Brad Davidson 2025-03-06 10:14:16 +00:00 committed by Brad Davidson
parent 51fb5b7843
commit f13bf11348
1 changed files with 1 additions and 1 deletions

View File

@ -351,7 +351,7 @@ func createProxyAndValidateToken(ctx context.Context, cfg *cmds.Agent) (proxy.Pr
for {
newToken, err := clientaccess.ParseAndValidateToken(proxy.SupervisorURL(), cfg.Token, options...)
if err != nil {
logrus.Error(err)
logrus.Errorf("Failed to validate connection to cluster at %s: %v", cfg.ServerURL, err)
select {
case <-ctx.Done():
return nil, ctx.Err()