Skip to content

Enable platform external s390x#10588

Open
Neeraj8418 wants to merge 2 commits into
openshift:mainfrom
Neeraj8418:enable-platform-external-s390x
Open

Enable platform external s390x#10588
Neeraj8418 wants to merge 2 commits into
openshift:mainfrom
Neeraj8418:enable-platform-external-s390x

Conversation

@Neeraj8418
Copy link
Copy Markdown
Contributor

@Neeraj8418 Neeraj8418 commented Jun 2, 2026

Summary

Enable platform: external support for s390x architectures in assisted-service.

Changes

  • Modified GetActualCreateClusterPlatformParams() in internal/provider/platform.go
  • Allows external platform for s390x alongside existing none platform
  • Maintains mandatory user-managed networking requirement

Problem Solved

Fixes runtime error: Can't set external platform on s390x architecture

Previously, s390x were restricted to platform: none. This PR enables platform: external for custom cloud platforms (OCI, Nutanix, etc.) and edge computing scenarios.

Signed-off-by: Neeraj Mishra neeraj.mishra3@ibm.com

Summary by CodeRabbit

  • New Features
    • Added IBM Z external platform support with cloud controller manager configuration requirement
    • Extended s390x architecture to support external platform configuration option
    • Enhanced kernel argument configuration to set appropriate console parameters based on external platform type

- Add s390x to supported architectures for external platform
- Update agent image generation to support s390x external platform
- Modify kernel arguments handling for s390x
- Update install config validation for s390x external platform
@openshift-ci openshift-ci Bot requested review from bfournie and rwsu June 2, 2026 09:17
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 2, 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 zaneb 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
Copy Markdown

coderabbitai Bot commented Jun 2, 2026

Walkthrough

This PR adds IBM Z (s390x) external platform support to the OpenShift agent components. It introduces a new platform constant, expands validation to permit external platforms on s390x architectures, implements platform-specific kernel console arguments, and updates logging to reference platforms generically rather than OCI-specifically.

Changes

IBM Z External Platform Support

Layer / File(s) Summary
IBM Z Platform Constant Definition
pkg/asset/agent/common.go
Adds ExternalPlatformNameIBMZ = "ibmz" constant alongside existing OCI constant for platform identification.
Platform Validation and Configuration
pkg/asset/agent/installconfig.go
Expands s390x validation to allow external platform (previously only none), and adds IBM Z-specific validation requiring platform.external.cloudControllerManager to be set when external platform is IBMZ.
Platform-Specific Kernel Arguments
pkg/asset/agent/image/kargs.go
Refactors console argument selection from OCI-only conditional to switch statement handling both OCI (console=ttyS0) and IBM Z (console=ttysclp0) with corresponding debug logs.
Generic Platform Logging
pkg/asset/agent/image/agentimage.go
Updates log message to reference external platform type generically instead of OCI-specific wording while preserving condition and manifest directory guidance.

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main objective: enabling platform external support for s390x architecture, which is the core change across all modified files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed PR does not add or modify any Ginkgo tests; all tests use standard Go testing with static string names, making the check not applicable.
Test Structure And Quality ✅ Passed This codebase uses standard Go testing (testing.T) with testify, not Ginkgo. The custom check targets Ginkgo test quality but is not applicable here; no Ginkgo tests exist in the repository or PR.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests are added in this PR. The changes only modify agent configuration/validation files (common.go, agentimage.go, kargs.go, installconfig.go) with no test code added.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR does not add any new Ginkgo e2e tests. Changes are limited to non-test files: common.go, agentimage.go, kargs.go, and installconfig.go. The custom check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies installer asset code, not deployment manifests. No scheduling constraints introduced—only config and validation changes for s390x support.
Ote Binary Stdout Contract ✅ Passed Modified files are library asset generators with no process-level entry points. Logging uses logrus (stderr) within methods, not in initialization. No fmt.Print or stdout writes.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No Ginkgo e2e tests added in this PR. Changes are to configuration/utility files (common.go, agentimage.go, kargs.go, installconfig.go) that implement s390x platform support without test additions.
No-Weak-Crypto ✅ Passed PR introduces no weak crypto usage, custom crypto implementations, or non-constant-time secret comparisons. Changes involve only platform constants, logging, kernel arguments, and validation logic.
Container-Privileges ✅ Passed PR modifies only Go source code files. No Kubernetes manifests or container privilege escalation settings found.
No-Sensitive-Data-In-Logs ✅ Passed Log statements only output non-sensitive data: platform constants and directory paths. No passwords, tokens, API keys, PII, or sensitive data are exposed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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.12.2)

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
pkg/asset/agent/installconfig.go (1)

137-154: ⚡ Quick win

Consider refactoring duplicated validation logic.

The OCI and IBM Z platform validation blocks (lines 139-145 and 147-153) are nearly identical, differing only in the constant name. This duplication could be reduced by extracting the validation into a helper function or iterating over a list of platforms that require external cloud controller manager.

♻️ Proposed refactor to eliminate duplication
 func (a *OptionalInstallConfig) validatePlatformsByName(installConfig *types.InstallConfig) field.ErrorList {
 	var allErrs field.ErrorList
 
 	if installConfig.Platform.Name() == external.Name {
-		// Validate OCI platform requirements
-		if installConfig.Platform.External.PlatformName == ExternalPlatformNameOci &&
-			installConfig.Platform.External.CloudControllerManager != external.CloudControllerManagerTypeExternal {
-			fieldPath := field.NewPath("platform", "external", "cloudControllerManager")
-			allErrs = append(allErrs, field.Invalid(fieldPath, installConfig.Platform.External.CloudControllerManager,
-				fmt.Sprintf("When using external %s platform, %s must be set to %s",
-					ExternalPlatformNameOci, fieldPath, external.CloudControllerManagerTypeExternal)))
-		}
-		// Validate IBM Z platform requirements
-		if installConfig.Platform.External.PlatformName == ExternalPlatformNameIBMZ &&
-			installConfig.Platform.External.CloudControllerManager != external.CloudControllerManagerTypeExternal {
-			fieldPath := field.NewPath("platform", "external", "cloudControllerManager")
-			allErrs = append(allErrs, field.Invalid(fieldPath, installConfig.Platform.External.CloudControllerManager,
-				fmt.Sprintf("When using external %s platform, %s must be set to %s",
-					ExternalPlatformNameIBMZ, fieldPath, external.CloudControllerManagerTypeExternal)))
-		}
+		// Validate external platform requirements for platforms requiring external CCM
+		platformsRequiringExternalCCM := []string{ExternalPlatformNameOci, ExternalPlatformNameIBMZ}
+		for _, platformName := range platformsRequiringExternalCCM {
+			if installConfig.Platform.External.PlatformName == platformName &&
+				installConfig.Platform.External.CloudControllerManager != external.CloudControllerManagerTypeExternal {
+				fieldPath := field.NewPath("platform", "external", "cloudControllerManager")
+				allErrs = append(allErrs, field.Invalid(fieldPath, installConfig.Platform.External.CloudControllerManager,
+					fmt.Sprintf("When using external %s platform, %s must be set to %s",
+						platformName, fieldPath, external.CloudControllerManagerTypeExternal)))
+				break
+			}
+		}
 	}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/asset/agent/installconfig.go` around lines 137 - 154, Refactor the
duplicated OCI/IBM Z validation by extracting the repeated logic into a small
helper (e.g., validateExternalPlatformCCM) that takes the platform name constant
(ExternalPlatformNameOci or ExternalPlatformNameIBMZ), the
installConfig.Platform.External values, the shared fieldPath construction, and
the allErrs slice; the helper should check External.PlatformName == provided
name && External.CloudControllerManager !=
external.CloudControllerManagerTypeExternal and append the same field.Invalid
error using fieldPath and
installConfig.Platform.External.CloudControllerManager. Replace the two nearly
identical blocks with either calls to that helper for each constant or a loop
over []string{ExternalPlatformNameOci, ExternalPlatformNameIBMZ} invoking the
helper to keep behavior identical.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@pkg/asset/agent/installconfig.go`:
- Around line 137-154: Refactor the duplicated OCI/IBM Z validation by
extracting the repeated logic into a small helper (e.g.,
validateExternalPlatformCCM) that takes the platform name constant
(ExternalPlatformNameOci or ExternalPlatformNameIBMZ), the
installConfig.Platform.External values, the shared fieldPath construction, and
the allErrs slice; the helper should check External.PlatformName == provided
name && External.CloudControllerManager !=
external.CloudControllerManagerTypeExternal and append the same field.Invalid
error using fieldPath and
installConfig.Platform.External.CloudControllerManager. Replace the two nearly
identical blocks with either calls to that helper for each constant or a loop
over []string{ExternalPlatformNameOci, ExternalPlatformNameIBMZ} invoking the
helper to keep behavior identical.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 8ad641a8-227a-449c-b6d1-7f8e83fd8d92

📥 Commits

Reviewing files that changed from the base of the PR and between e871a5d and 1660d8c.

📒 Files selected for processing (4)
  • pkg/asset/agent/common.go
  • pkg/asset/agent/image/agentimage.go
  • pkg/asset/agent/image/kargs.go
  • pkg/asset/agent/installconfig.go

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 2, 2026

@Neeraj8418: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-agent-compact-ipv4-iso-no-registry 1660d8c link false /test e2e-agent-compact-ipv4-iso-no-registry
ci/prow/e2e-agent-compact-ipv4-appliance-diskimage 1660d8c link false /test e2e-agent-compact-ipv4-appliance-diskimage
ci/prow/e2e-agent-two-node-fencing-ipv4 1660d8c link false /test e2e-agent-two-node-fencing-ipv4
ci/prow/unit 1660d8c link true /test unit

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant