-
Notifications
You must be signed in to change notification settings - Fork 235
使用crypto/ssh代替本地ssh命令行工具的依赖 #162
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
Conversation
} | ||
|
||
// ForwardRemoteToLocal indicates an expected call of ForwardRemoteToLocal | ||
func (mr *MockChannelMockRecorder) ForwardRemoteToLocal(certificate, sshAddress, remoteEndpoint, localEndpoint interface{}) *gomock.Call { |
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.
Similar blocks of code found in 4 locations. Consider refactoring.
) | ||
} | ||
|
||
func startVPNConnection(rootCtx context.Context, cli exec.CliInterface, credential *util.SSHCredential, |
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.
Function startVPNConnection
has 7 arguments (exceeds 4 allowed). Consider refactoring.
} | ||
|
||
// StartSocks5Proxy indicates an expected call of StartSocks5Proxy | ||
func (mr *MockChannelMockRecorder) StartSocks5Proxy(certificate, sshAddress, socks5Address interface{}) *gomock.Call { |
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.
Similar blocks of code found in 6 locations. Consider refactoring.
pkg/kt/channel/ssh.go
Outdated
} | ||
|
||
// DynamicPortForward create socks5 proxy | ||
func DynamicPortForward(username string, password string, address string, socks5Address string) error { |
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.
Function DynamicPortForward
has 5 return statements (exceeds 4 allowed).
pkg/kt/channel/ssh.go
Outdated
} | ||
|
||
// ForwardRemoteToLocal forward remote request to local | ||
func ForwardRemoteToLocal(username string, password string, address string, remoteEndpoint string, localEndpoint string) (err error) { |
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.
Function ForwardRemoteToLocal
has 5 arguments (exceeds 4 allowed). Consider refactoring.
type SSHChannel struct{} | ||
|
||
// StartSocks5Proxy start socks5 proxy | ||
func (c *SSHChannel) StartSocks5Proxy(certificate *Certificate, sshAddress string, socks5Address string) (err error) { |
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.
Method SSHChannel.StartSocks5Proxy
has 5 return statements (exceeds 4 allowed).
wg.Wait() | ||
} | ||
|
||
func exposeLocalPortToRemote(wg sync.WaitGroup, ssh channel.Channel, remotePort string, localPort string, localSSHPort int) { |
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.
Function exposeLocalPortToRemote
has 5 arguments (exceeds 4 allowed). Consider refactoring.
return nil | ||
} | ||
|
||
func portForward(rootCtx context.Context, kubernetesCli kubectl.CliInterface, podName string, localSSHPort int, |
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.
Function portForward
has 6 arguments (exceeds 4 allowed). Consider refactoring.
return outbound(s, name, podIP, credential, cidrs, cli, &ssh) | ||
} | ||
|
||
func outbound(s *Shadow, name, podIP string, credential *util.SSHCredential, cidrs []string, cli exec.CliInterface, ssh channel.Channel) (err error) { |
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.
Function outbound
has 6 arguments (exceeds 4 allowed). Consider refactoring.
Code Climate has analyzed commit fe8ee2f and detected 51 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
No description provided.