diff --git a/cmd/agent/core/agent.go b/cmd/agent/core/agent.go index cba6249b1..56d3119ba 100644 --- a/cmd/agent/core/agent.go +++ b/cmd/agent/core/agent.go @@ -133,7 +133,7 @@ func run(ctx context.Context, c *cli.Command, backends []types.Backend) error { agentConfig := readAgentConfig(agentConfigPath) - agentToken := c.String("grpc-token") + agentToken := strings.TrimSpace(c.String("grpc-token")) grpcClientCtx, grpcClientCtxCancel := context.WithCancelCause(context.Background()) defer grpcClientCtxCancel(nil) authClient := agent_rpc.NewAuthGrpcClient(authConn, agentToken, agentConfig.AgentID)