Skip to content

Commit

Permalink
feature: use 'uname -n' instead of 'hostname' to get hostname (#2197)
Browse files Browse the repository at this point in the history
fixes: #2194

The `hostname` command may need to be downloaded on some machines,
but the `uname` command is always present.

Signed-off-by: Pengda Yang <daz-3ux@proton.me>
  • Loading branch information
Daz-3ux authored Apr 27, 2023
1 parent eeede74 commit 220a1ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/infradriver/ssh_infradriver.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func (d *SSHInfraDriver) GetClusterLaunchApps() []string {
}

func (d *SSHInfraDriver) GetHostName(hostIP net.IP) (string, error) {
hostName, err := d.CmdToString(hostIP, nil, "hostname", "")
hostName, err := d.CmdToString(hostIP, nil, "uname -n", "")
if err != nil {
return "", err
}
Expand Down

0 comments on commit 220a1ca

Please sign in to comment.