From 63c2ee8c833d60f0c7a14c4a7a52f3057b21cefc Mon Sep 17 00:00:00 2001 From: Abhinav Dahiya Date: Fri, 2 Nov 2018 12:14:22 -0700 Subject: [PATCH] pkg/asset/machines/libvirt: allow empty machinepool Empty machinepool is a valid for libvirt because we don't use it. Fixes the error ```console FATAL Error executing openshift-install: non-Libvirt machine-pool: "" `` introduced in https://github.com/openshift/installer/pull/573 --- pkg/asset/machines/libvirt/machines.go | 3 ++- pkg/asset/machines/libvirt/machinesets.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/asset/machines/libvirt/machines.go b/pkg/asset/machines/libvirt/machines.go index 2a8fb3dccaf..7dfe4c92c25 100644 --- a/pkg/asset/machines/libvirt/machines.go +++ b/pkg/asset/machines/libvirt/machines.go @@ -17,7 +17,8 @@ func Machines(config *types.InstallConfig, pool *types.MachinePool, role, userDa if configPlatform := config.Platform.Name(); configPlatform != types.PlatformNameLibvirt { return nil, fmt.Errorf("non-Libvirt configuration: %q", configPlatform) } - if poolPlatform := pool.Platform.Name(); poolPlatform != types.PlatformNameLibvirt { + // FIXME: empty is a valid case for Libvirt as we don't use it. + if poolPlatform := pool.Platform.Name(); poolPlatform != "" && poolPlatform != types.PlatformNameLibvirt { return nil, fmt.Errorf("non-Libvirt machine-pool: %q", poolPlatform) } clustername := config.ObjectMeta.Name diff --git a/pkg/asset/machines/libvirt/machinesets.go b/pkg/asset/machines/libvirt/machinesets.go index 953a6100eb8..baea64e0b54 100644 --- a/pkg/asset/machines/libvirt/machinesets.go +++ b/pkg/asset/machines/libvirt/machinesets.go @@ -17,7 +17,8 @@ func MachineSets(config *types.InstallConfig, pool *types.MachinePool, role, use if configPlatform := config.Platform.Name(); configPlatform != types.PlatformNameLibvirt { return nil, fmt.Errorf("non-Libvirt configuration: %q", configPlatform) } - if poolPlatform := pool.Platform.Name(); poolPlatform != types.PlatformNameLibvirt { + // FIXME: empty is a valid case for Libvirt as we don't use it. + if poolPlatform := pool.Platform.Name(); poolPlatform != "" && poolPlatform != types.PlatformNameLibvirt { return nil, fmt.Errorf("non-Libvirt machine-pool: %q", poolPlatform) } clustername := config.ObjectMeta.Name