Merge pull request #11440 from ashley-cui/ssh

Use default username for podman machine ssh
This commit is contained in:
OpenShift Merge Robot
2021-09-13 14:34:29 -04:00
committed by GitHub
3 changed files with 45 additions and 2 deletions

View File

@ -488,7 +488,12 @@ func (v *MachineVM) SSH(name string, opts machine.SSHOptions) error {
return errors.Errorf("vm %q is not running.", v.Name)
}
sshDestination := v.RemoteUsername + "@localhost"
username := opts.Username
if username == "" {
username = v.RemoteUsername
}
sshDestination := username + "@localhost"
port := strconv.Itoa(v.Port)
args := []string{"-i", v.IdentityPath, "-p", port, sshDestination, "-o", "UserKnownHostsFile /dev/null", "-o", "StrictHostKeyChecking no"}