From db2910fed9638b39e01e202212b18f2ac2565941 Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Mon, 28 Feb 2022 19:17:20 +0100 Subject: [PATCH] distro/rhel86+90: common error message for unsupported customizations Use the same error message for both edge-installer and edge-simplified-installer when an unsupported customization is added. --- internal/distro/rhel86/distro.go | 5 +++-- internal/distro/rhel90/distro.go | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/distro/rhel86/distro.go b/internal/distro/rhel86/distro.go index 0bbcd43bb..9ad3334ad 100644 --- a/internal/distro/rhel86/distro.go +++ b/internal/distro/rhel86/distro.go @@ -562,8 +562,9 @@ func (t *imageType) checkOptions(customizations *blueprint.Customizations, optio } if t.name == "edge-simplified-installer" { - if err := customizations.CheckAllowed("InstallationDevice", "FDO"); err != nil { - return fmt.Errorf("boot ISO image type %q contains unsupported blueprint customizations: %v", t.name, err) + allowed := []string{"InstallationDevice", "FDO"} + if err := customizations.CheckAllowed(allowed...); err != nil { + return fmt.Errorf("unsupported blueprint customizations found for boot ISO image type %q: (allowed: %s)", t.name, strings.Join(allowed, ", ")) } if customizations.GetInstallationDevice() == "" { return fmt.Errorf("boot ISO image type %q requires specifying an installation device to install to", t.name) diff --git a/internal/distro/rhel90/distro.go b/internal/distro/rhel90/distro.go index 17622b6ee..629536005 100644 --- a/internal/distro/rhel90/distro.go +++ b/internal/distro/rhel90/distro.go @@ -550,8 +550,9 @@ func (t *imageType) checkOptions(customizations *blueprint.Customizations, optio } if t.name == "edge-simplified-installer" { - if err := customizations.CheckAllowed("InstallationDevice", "FDO"); err != nil { - return fmt.Errorf("boot ISO image type %q contains unsupported blueprint customizations: %v", t.name, err) + allowed := []string{"InstallationDevice", "FDO"} + if err := customizations.CheckAllowed(allowed...); err != nil { + return fmt.Errorf("unsupported blueprint customizations found for boot ISO image type %q: (allowed: %s)", t.name, strings.Join(allowed, ", ")) } if customizations.GetInstallationDevice() == "" { return fmt.Errorf("boot ISO image type %q requires specifying an installation device to install to", t.name)