Merge pull request #19794 from baude/remoteusername

Small fixes for hyperv
This commit is contained in:
Daniel J Walsh
2023-08-30 06:15:23 -04:00
committed by GitHub

View File

@ -131,7 +131,7 @@ Description=vsock_network
After=NetworkManager.service
[Service]
ExecStart=/usr/libexec/podman/vm -preexisting -iface vsock0 -url vsock://2:%d/connect
ExecStart=/usr/libexec/podman/gvforwader -preexisting -iface vsock0 -url vsock://2:%d/connect
ExecStartPost=/usr/bin/nmcli c up vsock0
[Install]
@ -215,6 +215,7 @@ func (m *HyperVMachine) Init(opts machine.InitOptions) (bool, error) {
}
m.Port = sshPort
m.RemoteUsername = opts.Username
err = machine.AddSSHConnectionsToPodmanSocket(
m.UID,
m.Port,
@ -256,16 +257,8 @@ func (m *HyperVMachine) Init(opts machine.InitOptions) (bool, error) {
return false, err
}
// c/common sets the default machine user for "windows" to be "user"; this
// is meant for the WSL implementation that does not use FCOS. For FCOS,
// however, we want to use the DefaultIgnitionUserName which is currently
// "core"
user := opts.Username
if user == "user" {
user = machine.DefaultIgnitionUserName
}
// Write the ignition file
if err := m.writeIgnitionConfigFile(opts, user, key); err != nil {
if err := m.writeIgnitionConfigFile(opts, m.RemoteUsername, key); err != nil {
return false, err
}
// The ignition file has been written. We now need to