fix: Resolve deleted node status display issue (#9633)

This commit is contained in:
ssongliu 2025-07-24 10:23:45 +08:00 committed by GitHub
parent 0cfdf0f335
commit 0daf0d690c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -56,6 +56,9 @@ func NewClient(c ConnInfo) (*SSHClient, error) {
return nil, err
}
sshClient := &SSHClient{Client: client}
if c.User == "root" {
return sshClient, nil
}
if _, err := sshClient.Run("sudo -n ls"); err == nil {
sshClient.SudoItem = "sudo"
}