New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use serverUID for web scp target #23124
Conversation
Revert unneeded hostname change Remove comment Get name
Changing the |
lib/web/files.go
Outdated
@@ -106,7 +106,7 @@ func (f *fileTransfer) download(req fileTransferRequest, httpReq *http.Request, | |||
return trace.Wrap(err) | |||
} | |||
|
|||
err = tc.ExecuteSCP(httpReq.Context(), cmd) | |||
err = tc.ExecuteSCP(httpReq.Context(), req.server, cmd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not too much trouble, can we rename server
to serverID
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No trouble at all! Fixed. much more clear this way.
nodeClient, err := tc.ConnectToNode( | ||
ctx, | ||
proxyClient, | ||
NodeDetails{Addr: nodeAddrs[0], Namespace: tc.Namespace, Cluster: tc.SiteName}, | ||
NodeDetails{Addr: serverAddr + ":0", Namespace: tc.Namespace, Cluster: tc.SiteName}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I'm not sure what the :0
is or why it's necessary. Once you figure it out, a comment is probably warranted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment!
* Use serverUID for scp target Revert unneeded hostname change Remove comment Get name * Change name to serverId * Fix lint errors * Add comment * Fix comment and signature format
* Use serverUID for scp target Revert unneeded hostname change Remove comment Get name * Change name to serverId * Fix lint errors * Add comment * Fix comment and signature format
Fixes #22507
To fix this, I pass the unique server id present in the http request rather than a node name. A similar fix for Connect exists here