Skip to content

OCPBUGS-6508: Update Control Plane replica validation for Single Node OpenShift #9048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion pkg/asset/machines/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,17 @@ func (m *Master) Generate(ctx context.Context, dependencies asset.Parents) error
var ipClaims []ipamv1.IPAddressClaim
var ipAddrs []ipamv1.IPAddress
var controlPlaneMachineSet *machinev1.ControlPlaneMachineSet

// Check if SNO topology is supported on this platform
if pool.Replicas != nil && *pool.Replicas == 1 {
bootstrapInPlace := false
if ic.BootstrapInPlace != nil {
bootstrapInPlace = true
}
if !supportedSingleNodePlatform(bootstrapInPlace, ic.Platform.Name()) {
return fmt.Errorf("this install method does not support Single Node installation on platform %s", ic.Platform.Name())
}
}
switch ic.Platform.Name() {
case awstypes.Name:
subnets, err := aws.MachineSubnetsByZones(ctx, installConfig, awstypes.ClusterNodeSubnetRole)
Expand Down Expand Up @@ -967,6 +978,20 @@ func IsFencingCredentialsFile(filepath string) (bool, error) {
if err != nil {
return false, err
}

return match, nil
}

// supportedSingleNodePlatform indicates if the IPI Installer can be used to install SNO on
// a platform.
func supportedSingleNodePlatform(bootstrapInPlace bool, platformName string) bool {
switch platformName {
case awstypes.Name, gcptypes.Name, azuretypes.Name, powervstypes.Name:
// Single node OpenShift installations supported without `bootstrapInPlace`
return true
case nonetypes.Name, externaltypes.Name:
// Single node OpenShift installations supported with `bootstrapInPlace`
return bootstrapInPlace
default:
return false
}
}
4 changes: 2 additions & 2 deletions pkg/asset/machines/master_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,14 +275,14 @@ func TestBaremetalGeneratedAssetFiles(t *testing.T) {
},
},
ControlPlane: &types.MachinePool{
Replicas: pointer.Int64Ptr(1),
Replicas: ptr.To[int64](3),
Platform: types.MachinePoolPlatform{
BareMetal: &baremetal.MachinePool{},
},
},
Compute: []types.MachinePool{
{
Replicas: pointer.Int64Ptr(1),
Replicas: ptr.To[int64](1),
Platform: types.MachinePoolPlatform{},
},
},
Expand Down