From 8efc56fe4a58c41279eef45e13b96aa5631cfb88 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Wed, 18 Dec 2019 11:46:35 -0500 Subject: [PATCH] platform: add hack to use openstack fetcher for s390x qemu 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: https://github.com/coreos/coreos-assembler/pull/1004 https://github.com/coreos/ignition-dracut/pull/145 https://github.com/coreos/ignition/issues/825 --- internal/platform/platform.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/platform/platform.go b/internal/platform/platform.go index e32f641b64..626fbd5f08 100644 --- a/internal/platform/platform.go +++ b/internal/platform/platform.go @@ -16,6 +16,7 @@ package platform import ( "fmt" + "runtime" "github.com/coreos/ignition/v2/internal/log" "github.com/coreos/ignition/v2/internal/providers" @@ -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, @@ -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))