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))