mirror of
https://github.com/appleboy/drone-ssh.git
synced 2025-05-06 18:02:48 +08:00
refactor: refactor SSH authentication handling with switch statement
- Refactor if-else logic to a switch statement for handling SSH authentication methods Signed-off-by: appleboy <appleboy.tw@gmail.com>
This commit is contained in:
parent
1849c53ed5
commit
4a649cfe45
@ -974,9 +974,10 @@ func runSSHContainerTest(t *testing.T, cfg SSHTestConfig) {
|
||||
if pluginCfg.CommandTimeout == 0 {
|
||||
pluginCfg.CommandTimeout = 10 * time.Second
|
||||
}
|
||||
if cfg.AuthMethod == "key" {
|
||||
switch cfg.AuthMethod {
|
||||
case "key":
|
||||
pluginCfg.KeyPath = cfg.KeyPath
|
||||
} else if cfg.AuthMethod == "password" {
|
||||
case "password":
|
||||
pluginCfg.Password = cfg.Password
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user