Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes for hyperv #19794

Merged
merged 2 commits into from
Aug 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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