From 79834b440ba5b108c6b036d6ca59d88d24761768 Mon Sep 17 00:00:00 2001 From: ehila Date: Tue, 9 Jun 2026 02:37:00 -0400 Subject: [PATCH] feat: allow sno baremetal platform install Signed-off-by: ehila --- pkg/asset/machines/master.go | 2 +- pkg/asset/machines/master_test.go | 24 ++++++++++++++++++++++ pkg/types/validation/installconfig.go | 9 -------- pkg/types/validation/installconfig_test.go | 3 +-- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/pkg/asset/machines/master.go b/pkg/asset/machines/master.go index 9a46ef858f3..7404b34c5c9 100644 --- a/pkg/asset/machines/master.go +++ b/pkg/asset/machines/master.go @@ -1064,7 +1064,7 @@ func IsFencingCredentialsFile(filepath string) (bool, error) { // a platform. func supportedSingleNodePlatform(bootstrapInPlace bool, platformName string) bool { switch platformName { - case awstypes.Name, gcptypes.Name, azuretypes.Name, powervstypes.Name, nonetypes.Name, ibmcloudtypes.Name: + case awstypes.Name, gcptypes.Name, azuretypes.Name, powervstypes.Name, nonetypes.Name, ibmcloudtypes.Name, baremetaltypes.Name: // Single node OpenShift installations supported without `bootstrapInPlace` return true case externaltypes.Name: diff --git a/pkg/asset/machines/master_test.go b/pkg/asset/machines/master_test.go index 0eb7f7a98de..6faa56d7451 100644 --- a/pkg/asset/machines/master_test.go +++ b/pkg/asset/machines/master_test.go @@ -597,6 +597,30 @@ func TestSupportedSNOPlatforms(t *testing.T) { machinePoolPlatform: types.MachinePoolPlatform{}, expectedError: true, }, + { + name: "Baremetal platform with bootstrapInPlace", + platform: types.Platform{ + BareMetal: &baremetal.Platform{ + Hosts: []*baremetal.Host{ + { + Name: "master-0", + Role: "master", + BMC: baremetal.BMC{ + Username: "usr-0", + Password: "pwd-0", + }, + }, + }, + }, + }, + bootstrapInPlace: &types.BootstrapInPlace{ + InstallationDisk: "/dev/sda", + }, + machinePoolPlatform: types.MachinePoolPlatform{ + BareMetal: &baremetal.MachinePool{}, + }, + expectedError: false, + }, { name: "Nutanix platform", platform: types.Platform{ diff --git a/pkg/types/validation/installconfig.go b/pkg/types/validation/installconfig.go index d6c088ee596..8487dc13a40 100644 --- a/pkg/types/validation/installconfig.go +++ b/pkg/types/validation/installconfig.go @@ -148,15 +148,6 @@ func ValidateInstallConfig(c *types.InstallConfig, usingAgentMethod bool) field. allErrs = append(allErrs, field.Required(field.NewPath("controlPlane"), "controlPlane is required")) } - if c.BootstrapInPlace != nil && c.ControlPlane.Replicas != nil && - *c.ControlPlane.Replicas == 1 && c.Platform.Name() == baremetal.Name { - allErrs = append(allErrs, field.Invalid( - field.NewPath("bootstrapInPlace"), - "", - "Single Node OpenShift is not supported on the baremetal platform", - )) - } - if c.Arbiter != nil { allErrs = append(allErrs, validateArbiter(&c.Platform, c.Arbiter, c.ControlPlane, field.NewPath("arbiter"))...) } diff --git a/pkg/types/validation/installconfig_test.go b/pkg/types/validation/installconfig_test.go index ef7e2372c13..04af36af70c 100644 --- a/pkg/types/validation/installconfig_test.go +++ b/pkg/types/validation/installconfig_test.go @@ -3088,7 +3088,7 @@ func TestValidateInstallConfig(t *testing.T) { expectedError: "osImageStream: Unsupported value: \"invalid\": supported values: \"rhel-9\", \"rhel-10\"", }, { - name: "sno on baremetal not supported", + name: "sno on baremetal", installConfig: func() *types.InstallConfig { c := validInstallConfig() c.Platform = types.Platform{ @@ -3099,7 +3099,6 @@ func TestValidateInstallConfig(t *testing.T) { } return c }(), - expectedError: `^bootstrapInPlace: Invalid value: "": Single Node OpenShift is not supported on the baremetal platform$`, }, } for _, tc := range cases {