Skip to content

OCPEDGE-2255: baremetal: reject SNO installation on baremetal platform#10420

Open
fracappa wants to merge 1 commit intoopenshift:mainfrom
fracappa:fcp/sno-baremetal-unsupported
Open

OCPEDGE-2255: baremetal: reject SNO installation on baremetal platform#10420
fracappa wants to merge 1 commit intoopenshift:mainfrom
fracappa:fcp/sno-baremetal-unsupported

Conversation

@fracappa
Copy link

Add install-config validation to prevent SNO dpeloyments on the baremetal platform, providing immediate feedback instead of failing later

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 23, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 23, 2026

@fracappa: This pull request references OCPEDGE-2255 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Add install-config validation to prevent SNO dpeloyments on the baremetal platform, providing immediate feedback instead of failing later

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from bfournie and rwsu March 23, 2026 15:28
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 23, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign pawanpinjarkar for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai
Copy link

coderabbitai bot commented Mar 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a9a96b97-5072-436a-92d2-9f330d765ce3

📥 Commits

Reviewing files that changed from the base of the PR and between 175e449 and 5b9a8d0.

📒 Files selected for processing (2)
  • pkg/types/validation/installconfig.go
  • pkg/types/validation/installconfig_test.go
✅ Files skipped from review due to trivial changes (1)
  • pkg/types/validation/installconfig_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/types/validation/installconfig.go

Walkthrough

ValidateInstallConfig now rejects configurations that set BootstrapInPlace when the install platform is baremetal, appending a field.Invalid error stating "Single Node OpenShift is not supported on the baremetal platform". A test exercising BootstrapInPlace.InstallationDisk on baremetal was added.

Changes

Cohort / File(s) Summary
Baremetal bootstrapInPlace validation
pkg/types/validation/installconfig.go, pkg/types/validation/installconfig_test.go
Added a conditional in ValidateInstallConfig to append a field.Invalid error on bootstrapInPlace when c.BootstrapInPlace is set and platform is baremetal. Added a unit test constructing a baremetal InstallConfig with BootstrapInPlace.InstallationDisk set (e.g., "/dev/sda") that asserts the validation fails with the expected error message.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.11.3)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Add install-config validation to prevent SNO dpeloyments on the baremetal platform, providing immediate feedback instead of failing later
@fracappa fracappa force-pushed the fcp/sno-baremetal-unsupported branch from e133286 to 5b9a8d0 Compare March 23, 2026 16:45
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 23, 2026

@fracappa: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

allErrs = append(allErrs, field.Required(field.NewPath("controlPlane"), "controlPlane is required"))
}

if c.BootstrapInPlace != nil && c.Platform.Name() == baremetal.Name {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, the right way for checking if a cluster is SNO is to verify that that control-plane nodes replicas is set to 1. Bootstrap in place is also a key identifier, but you can install an SNO cluster without it, whereas all clusters with 1 control plane node are SNO.

@patrickdillon
Copy link
Contributor

It seems like we should already have validation for this:
41b6e16

@patrickdillon
Copy link
Contributor

It seems like we should already have validation for this: 41b6e16

Talking with @fracappa on slack: I agree pkg/types is a better place for this. We don't want to duplicate this logic within the installer, so moving the existing logic to pkg/types seems like a win.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants