Skip to content

Commit

Permalink
Merge pull request #19794 from baude/remoteusername
Browse files Browse the repository at this point in the history
Small fixes for hyperv
  • Loading branch information
rhatdan authored Aug 30, 2023
2 parents 16f6d6a + 1085177 commit 8114923
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions pkg/machine/hyperv/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8114923

Please sign in to comment.