diff --git a/internal/provider/registry/registry.go b/internal/provider/registry/registry.go index c63ea17486..f20f568450 100644 --- a/internal/provider/registry/registry.go +++ b/internal/provider/registry/registry.go @@ -103,7 +103,7 @@ func (r *registry) IsHostSupported(p models.PlatformType, host *models.Host) (bo currentProvider, err := r.Get(string(p)) if err != nil { return false, fmt.Errorf("error while checking if hosts are supported by platform %s, error %w", - currentProvider.Name(), err) + string(p), err) } return currentProvider.IsHostSupported(host) } diff --git a/internal/provider/registry/registry_test.go b/internal/provider/registry/registry_test.go index c9380ff213..ffe64cad13 100644 --- a/internal/provider/registry/registry_test.go +++ b/internal/provider/registry/registry_test.go @@ -142,6 +142,15 @@ var _ = Describe("Test GetSupportedProvidersByHosts", func() { }) }) +var _ = Describe("IsHostSupported", func() { + It("platform not found", func() { + providerRegistry = InitProviderRegistry(common.GetTestLog()) + found, err := providerRegistry.IsHostSupported("none-existing-platform-type", &models.Host{}) + Expect(err).NotTo(Succeed()) + Expect(found).To(BeFalse()) + }) +}) + var _ = Describe("Test AddPlatformToInstallConfig", func() { BeforeEach(func() { providerRegistry = InitProviderRegistry(common.GetTestLog())