Skip to content

Commit

Permalink
Merge pull request containers#9873 from baude/correctaarch64
Browse files Browse the repository at this point in the history
resolve proper aarch64 image names
  • Loading branch information
openshift-merge-robot authored Mar 30, 2021
2 parents 5e28b35 + b6089a5 commit f7ad9fb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
16 changes: 12 additions & 4 deletions pkg/machine/fcos_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package machine

import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
url2 "net/url"

"github.com/sirupsen/logrus"
)
Expand All @@ -14,9 +14,7 @@ const aarchBaseURL = "https://fedorapeople.org/groups/fcos-images/builds/latest/
// Total hack until automation is possible.
// We need a proper json file at least to automate
func getFCOSDownload() (*fcosDownloadInfo, error) {

meta := Build{}
fmt.Println(aarchBaseURL + "meta.json")
resp, err := http.Get(aarchBaseURL + "meta.json")
if err != nil {
return nil, err
Expand All @@ -33,8 +31,18 @@ func getFCOSDownload() (*fcosDownloadInfo, error) {
if err := json.Unmarshal(body, &meta); err != nil {
return nil, err
}
pathURL, err := url2.Parse(meta.BuildArtifacts.Qemu.Path)
if err != nil {
return nil, err
}

baseURL, err := url2.Parse(aarchBaseURL)
if err != nil {
return nil, err
}
pullURL := baseURL.ResolveReference(pathURL)
return &fcosDownloadInfo{
Location: aarchBaseURL + "/" + meta.BuildArtifacts.Qemu.Path,
Location: pullURL.String(),
Release: "",
Sha256Sum: meta.BuildArtifacts.Qemu.Sha256,
}, nil
Expand Down
4 changes: 2 additions & 2 deletions pkg/machine/qemu/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func NewMachine(opts machine.InitOptions) (machine.VM, error) {
return nil, err
}
vm.QMPMonitor = monitor
cmd = append(cmd, []string{"-qmp", monitor.Network + ":/" + monitor.Address + ",server,nowait"}...)
cmd = append(cmd, []string{"-qmp", monitor.Network + ":/" + monitor.Address + ",server=on,wait=off"}...)

// Add network
cmd = append(cmd, "-nic", "user,model=virtio,hostfwd=tcp::"+strconv.Itoa(vm.Port)+"-:22")
Expand All @@ -95,7 +95,7 @@ func NewMachine(opts machine.InitOptions) (machine.VM, error) {
// Add serial port for readiness
cmd = append(cmd, []string{
"-device", "virtio-serial",
"-chardev", "socket,path=" + virtualSocketPath + ",server,nowait,id=" + vm.Name + "_ready",
"-chardev", "socket,path=" + virtualSocketPath + ",server=on,wait=off,id=" + vm.Name + "_ready",
"-device", "virtserialport,chardev=" + vm.Name + "_ready" + ",name=org.fedoraproject.port.0"}...)
vm.CmdLine = cmd
return vm, nil
Expand Down

0 comments on commit f7ad9fb

Please sign in to comment.