Skip to content

Commit

Permalink
platform: add hack to use openstack fetcher for s390x qemu
Browse files Browse the repository at this point in the history
s390x doesn't support the qemu fw_cfg mechanism. Let's hack around this
for now by having the fetcher on s390x just use the same one as
OpenStack, i.e. config drives (and technically metadata server too,
which will fail... again, this is a short-term hack).

For background, see:
coreos/coreos-assembler#1004
coreos/ignition-dracut#145
coreos#825
  • Loading branch information
jlebon committed Dec 18, 2019
1 parent 40c0b57 commit 8efc56f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/platform/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package platform

import (
"fmt"
"runtime"

"github.com/coreos/ignition/v2/internal/log"
"github.com/coreos/ignition/v2/internal/providers"
Expand Down Expand Up @@ -126,6 +127,10 @@ func init() {
name: "qemu",
fetch: qemu.FetchConfig,
})
configs.Register(Config{
name: "qemu_s390x",
fetch: openstack.FetchConfig,
})
configs.Register(Config{
name: "file",
fetch: file.FetchConfig,
Expand All @@ -150,7 +155,10 @@ func Get(name string) (config Config, ok bool) {
}

func MustGet(name string) Config {
if config, ok := Get(name); ok {
// try to get arch-specific fetcher first
if config, ok := Get(fmt.Sprintf("%s_%s", name, runtime.GOARCH)); ok {
return config
} else if config, ok := Get(fmt.Sprintf(name)); ok {
return config
} else {
panic(fmt.Sprintf("invalid platform name %q provided", name))
Expand Down

0 comments on commit 8efc56f

Please sign in to comment.