Skip to content

Enable external platform support for s390x#10424

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

Enable external platform support for s390x#10424
Neeraj8418 wants to merge 2 commits into
openshift:masterfrom
Neeraj8418:enable-external-platform-s390x

Conversation

@Neeraj8418
Copy link
Copy Markdown

@Neeraj8418 Neeraj8418 commented Jun 2, 2026

https://github.com/openshift/installer/pull/10588

Summary

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

This change removes the restriction that prevented s390x from using platform: external, allowing these architectures to support custom platform integrations beyond the basic platform: none configuration.

Changes

  • Modified GetActualCreateClusterPlatformParams() in internal/provider/platform.go to accept external platform for s390x architectures
  • Added conditional logic to preserve external platform configuration when explicitly specified for these architectures
  • Maintained mandatory user-managed networking requirement for s390x.
  • External platform now works alongside the existing none platform support

Problem Solved

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

Background: Previously, s390x architectures were hardcoded to only accept platform: none. This limitation prevented users from:

  • Deploying on custom cloud platforms (OCI, Nutanix, etc.)
  • Using edge computing scenarios with external platform management
  • Maintaining consistent platform configuration across different architectures

Solution: This PR enables platform: external for s390x while preserving all existing validation and networking requirements, providing feature parity with other supported architectures.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborated below)
  • No tests needed

Manual Testing Details

Test Environment: s390x LPAR (a314lp41)

Test Steps:

  1. Installer Build: Built openshift-installer from companion branch with platform external support for s390x
  2. Configuration: Created install-config.yaml with:
    platform:
      external:
        platformName: none

This change allows the external platform type to be used with s390x and
ppc64le architectures, which previously only supported the 'none' platform.

Changes:
- Updated GetActualCreateClusterPlatformParams to allow external platform
  for s390x and ppc64le in addition to the existing 'none' platform
- Added logic to preserve external platform configuration when specified
- User-managed networking remains mandatory for these architectures

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

Signed-off-by: Neeraj Mishra <neeraj.mishra3@ibm.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 2, 2026

Walkthrough

The change refines CPU-architecture-specific platform validation in GetActualCreateClusterPlatformParams for s390x and ppc64le. External platforms are now allowed and returned with user-managed networking forced to true, while non-external non-none platforms reject with a 400 error, and other cases default to none platform with user-managed networking enabled.

Changes

Architecture-specific platform validation

Layer / File(s) Summary
s390x/ppc64le platform and networking rules
internal/provider/platform.go
The validation logic now permits external platforms and forces userManagedNetworking to true for them, while rejecting other non-none platforms with a 400 error and defaulting unmatched cases to platform none with userManagedNetworking forced to true.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 13 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Structure And Quality ⚠️ Warning No unit tests added for s390x/ppc64le external-platform handling in GetActualCreateClusterPlatformParams despite explicit review comment requesting them. Add table-driven unit tests covering s390x and ppc64le: external+UMN=true allowed; UMN=false rejected; non-none/non-external rejected.
✅ Passed checks (13 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically identifies the main change: enabling external platform support for s390x architecture, which directly matches the primary objective of the pull request.
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 only modifies internal/provider/platform.go (6 lines) with no test files added or Ginkgo test titles present. No dynamic test identifiers to check.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests added in this PR; it only modifies internal/provider/platform.go to enable external platform support for s390x/ppc64le.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests are added in this PR. Changes are limited to internal/provider/platform.go (+5/-1) enabling external platform for s390x/ppc64le.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies only validation logic in internal/provider/platform.go; no deployment manifests, operator code, controllers, or scheduling constraints are added.
Ote Binary Stdout Contract ✅ Passed PR modifies internal/provider/platform.go, a library package with no process-level code (main, init, TestMain, BeforeSuite, etc.). No stdout writes (fmt.Print, klog, log) detected in file.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR does not add any new Ginkgo e2e tests. Changes are limited to internal/provider/platform.go, a non-test file. The check is not applicable.
No-Weak-Crypto ✅ Passed No cryptographic operations present in the PR changes—the modification only adjusts platform validation logic for s390x/ppc64le architectures with simple control flow.
Container-Privileges ✅ Passed PR only modifies internal/provider/platform.go with Go code changes; no Kubernetes manifests, container specs, or Dockerfiles are modified.
No-Sensitive-Data-In-Logs ✅ Passed The code changes include only error messages logging enum values (platform type and CPU architecture), not sensitive data like passwords, tokens, keys, PII, or credentials.
Description check ✅ Passed Pull request description is comprehensive and follows the template structure with all major sections completed.

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

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

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.

@openshift-ci openshift-ci Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 2, 2026
@openshift-ci openshift-ci Bot requested review from avishayt and omertuc June 2, 2026 09:15
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Jun 2, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Neeraj8418
Once this PR has been reviewed and has the lgtm label, please assign bluesort 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

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.

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@internal/provider/platform.go`:
- Around line 313-317: Add table-driven unit tests that directly call
GetActualCreateClusterPlatformParams to exercise the cpuArchitecture == "s390x"
and "ppc64le" branches: for each arch, include cases where (1) platform is
external and userManagedNetworking (UMN) is true — expect success, (2) UMN is
false with external platform — expect rejection/error, and (3) platform is a
non-none/non-external type — expect rejection/error. Use the same platform
helper constructors used in production (e.g., createPlatformFromType and
common.IsPlatformExternal behavior) and assert returned platform, boolean flag,
and error matches expectations; reference the function name
GetActualCreateClusterPlatformParams, the cpuArchitecture parameter, and
models.PlatformTypeNone in your tests so the coverage specifically targets the
rejected/accepted logic for s390x/ppc64le.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: b6baca35-9d26-43f5-950c-fd23e3885cf6

📥 Commits

Reviewing files that changed from the base of the PR and between 3b239e5 and 31f1486.

📒 Files selected for processing (1)
  • internal/provider/platform.go

Comment on lines +313 to 317
// If platform is external, keep it; otherwise default to none
if platform != nil && common.IsPlatformExternal(platform) {
return platform, swag.Bool(true), nil
}
return createPlatformFromType(models.PlatformTypeNone), swag.Bool(true), nil
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find existing tests for GetActualCreateClusterPlatformParams and any s390x/ppc64le external coverage
rg -nP --type=go -C3 'GetActualCreateClusterPlatformParams' -g '*_test.go'
rg -nP --type=go -C3 '(S390x|Ppc64le).*([Ee]xternal)|([Ee]xternal).*(S390x|Ppc64le)' -g '*_test.go'

Repository: openshift/assisted-service

Length of output: 52


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 1) Locate platform external handling and the broader rejection logic
rg -n "IsPlatformExternal" -S --glob='*.go' .
rg -n "userManagedNetworking|UMN|ManagedNetworking" -S --glob='*.go' .
rg -n "ppc64le|s390x" -S --glob='*.go' .
rg -n "GetActualCreateClusterPlatformParams|create cluster platform|PlatformTypeExternal|PlatformTypeNone" -S --glob='*_test.go' .

# 2) Focus tests likely touching internal/provider/platform.go
rg -n "internal/provider/platform.go|platform\.go" -S --glob='*_test.go' .
rg -n "createPlatformFromType|PlatformTypeNone" -S --glob='*_test.go' .

# 3) List tests mentioning s390x/ppc64le explicitly
rg -n "ppc64le|s390x" -S --glob='*_test.go' .

Repository: openshift/assisted-service

Length of output: 50383


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 1) Inspect the exact create params logic around the requested line range
echo "---- internal/provider/platform.go: GetActualCreateClusterPlatformParams ----"
sed -n '260,360p' internal/provider/platform.go | nl -ba | sed -n '1,120p'

# 2) Find s390x/ppc64le occurrences in tests only (small, architecture-scoped)
echo "---- s390x occurrences in *_test.go ----"
rg -n --glob='*_test.go' -S "s390x" . | head -n 50

echo "---- ppc64le occurrences in *_test.go ----"
rg -n --glob='*_test.go' -S "ppc64le" . | head -n 50

# 3) Find External platform tests and check if they mention cpuArchitecture/arch
echo "---- External platform + architecture mentions in *_test.go ----"
rg -n --glob='*_test.go' -S "(External platform|PlatformTypeExternal|platform_is_external|IsPlatformExternal)" . | head -n 50

echo "---- External platform test file: agentclusterinstall_validation_hook_test.go (spot check around External cases) ----"
rg -n --glob='agentclusterinstall_validation_hook_test.go' -S "External platform" pkg/webhooks/hiveextension/v1beta1/agentclusterinstall_validation_hook_test.go -n

Repository: openshift/assisted-service

Length of output: 209


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 1) Inspect the exact create params logic around the requested line range
echo "---- internal/provider/platform.go: GetActualCreateClusterPlatformParams ----"
sed -n '260,360p' internal/provider/platform.go | nl -ba | sed -n '1,120p'

# 2) Find s390x/ppc64le occurrences in tests only
echo "---- s390x occurrences in *_test.go ----"
rg -n --glob='*_test.go' -S "s390x" . | head -n 50

echo "---- ppc64le occurrences in *_test.go ----"
rg -n --glob='*_test.go' -S "ppc64le" . | head -n 50

# 3) Find External platform tests (and quickly spot-check)
echo "---- External platform / PlatformTypeExternal occurrences in *_test.go ----"
rg -n --glob='*_test.go' -S "(External platform|PlatformTypeExternal|IsPlatformExternal|platform_is_external)" . | head -n 80

# 4) Check whether the webhook tests pass cpuArchitecture through (relevant to the s390x/ppc64le branch)
echo "---- cpuArchitecture mentions in hiveextension v1beta1 tests ----"
rg -n -S --glob='*_test.go' "cpuArchitecture" pkg/webhooks/hiveextension/v1beta1 . | head -n 50

Repository: openshift/assisted-service

Length of output: 209


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "---- internal/provider/platform.go: GetActualCreateClusterPlatformParams ----"
# show with line numbers via cat -n
sed -n '260,360p' internal/provider/platform.go | cat -n | sed -n '1,120p'

echo "---- s390x occurrences in *_test.go (head 50) ----"
rg -n --glob='*_test.go' -S "s390x" . | head -n 50

echo "---- ppc64le occurrences in *_test.go (head 50) ----"
rg -n --glob='*_test.go' -S "ppc64le" . | head -n 50

echo "---- External platform / PlatformTypeExternal / IsPlatformExternal occurrences in *_test.go (head 80) ----"
rg -n --glob='*_test.go' -S "(External platform|PlatformTypeExternal|IsPlatformExternal|platform_is_external)" . | head -n 80

echo "---- cpuArchitecture mentions in hiveextension v1beta1 tests (head 50) ----"
rg -n -S --glob='*_test.go' "cpuArchitecture" pkg/webhooks/hiveextension/v1beta1 . | head -n 50

Repository: openshift/assisted-service

Length of output: 38281


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "---- usages of GetActualCreateClusterPlatformParams in repo (tests + prod) ----"
rg -n "GetActualCreateClusterPlatformParams\\(" . --glob='*.go' | head -n 50

echo "---- look for exact error strings in *_test.go ----"
rg -n --glob='*_test.go' "Can't disable User Managed Networking on" . || true
rg -n --glob='*_test.go' "Can't set .* platform on .* architecture" . || true

echo "---- inspect hiveextension validation hook tests for cpuArchitecture in External platform cases ----"
rg -n --glob='agentclusterinstall_validation_hook_test.go' "External platform" pkg/webhooks/hiveextension/v1beta1/agentclusterinstall_validation_hook_test.go
rg -n --glob='agentclusterinstall_validation_hook_test.go' "CPUArchitecture|cpuArchitecture" pkg/webhooks/hiveextension/v1beta1/agentclusterinstall_validation_hook_test.go

Repository: openshift/assisted-service

Length of output: 2276


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="pkg/webhooks/hiveextension/v1beta1/agentclusterinstall_validation_hook_test.go"

# Inspect the External-platform create/update test cases to see what cpuArchitecture/CPUArchitecture is used
sed -n '620,820p' "$FILE" | cat -n
sed -n '820,900p' "$FILE" | cat -n

# Search within the same file for s390x/ppc64le mentions
rg -n "s390x|ppc64le|CPUArchitecture|cpuArchitecture" "$FILE" | head -n 200

# Look for tests combining external platform with s390x/ppc64le elsewhere
rg -n --glob='*_test.go' -S "(PlatformTypeExternal|External platform).*?(s390x|ppc64le)|(s390x|ppc64le).{0,120}?(PlatformTypeExternal|External platform)" . | head -n 200

Repository: openshift/assisted-service

Length of output: 11710


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="pkg/webhooks/hiveextension/v1beta1/agentclusterinstall_validation_hook_test.go"
echo "---- CPUArchitecture/cpuArchitecture mentions in $FILE ----"
rg -n --glob='*.go' -S "CPUArchitecture|cpuArchitecture" "$FILE" || true
rg -n --glob='*.go' -S "s390x|ppc64le|PlatformTypeExternal|ExternalPlatformType" "$FILE" | head -n 200 || true

echo "---- look for s390x/ppc64le + External platform combinations in *_test.go ----"
rg -n --glob='*_test.go' -S "(PlatformTypeExternal|External platform).{0,200}(s390x|ppc64le)|(s390x|ppc64le).{0,200}(PlatformTypeExternal|External platform)" . | head -n 200

echo "---- search for exact architecture-branch error strings in *_test.go ----"
rg -n --glob='*_test.go' -S "Can't disable User Managed Networking on|Can't set .* platform on .* architecture" . || true

echo "---- inspect provider call site in agentclusterinstall_validation_hook.go ----"
sed -n '330,430p' pkg/webhooks/hiveextension/v1beta1/agentclusterinstall_validation_hook.go | cat -n

Repository: openshift/assisted-service

Length of output: 5524


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="pkg/webhooks/hiveextension/v1beta1/agentclusterinstall_validation_hook_test.go"
echo "---- CPUArchitecture/cpuArchitecture mentions in $FILE ----"
rg -n -S "CPUArchitecture|cpuArchitecture" "$FILE" || true
rg -n -S "s390x|ppc64le|PlatformTypeExternal|ExternalPlatformType" "$FILE" | head -n 200 || true

echo "---- look for s390x/ppc64le + External platform combinations in *_test.go ----"
rg -n --glob='*_test.go' -S "(PlatformTypeExternal|External platform).{0,200}(s390x|ppc64le)|(s390x|ppc64le).{0,200}(PlatformTypeExternal|External platform)" . | head -n 200

echo "---- search for exact architecture-branch error strings in *_test.go ----"
rg -n --glob='*_test.go' -S "Can't disable User Managed Networking on|Can't set .* platform on .* architecture" . || true

echo "---- inspect provider call site in agentclusterinstall_validation_hook.go ----"
sed -n '330,430p' pkg/webhooks/hiveextension/v1beta1/agentclusterinstall_validation_hook.go | cat -n

Repository: openshift/assisted-service

Length of output: 5524


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search unit tests for direct calls
rg -n --glob='*_test.go' "GetActualCreateClusterPlatformParams\\(" . || true

# Search for the s390x/ppc64le-specific error messages
rg -n --glob='*_test.go' "Can't disable User Managed Networking on|Can't set .* platform on .* architecture|User Managed Networking on s390x|User Managed Networking on ppc64le" . || true

Repository: openshift/assisted-service

Length of output: 52


Add unit tests for the s390x/ppc64le external-platform handling in GetActualCreateClusterPlatformParams

  • The cpuArchitecture == s390x/ppc64le branch (UMN=false rejection, non-none/non-external rejection, external accepted) isn’t exercised by existing webhook unit tests because pkg/webhooks/hiveextension/v1beta1/agentclusterinstall_validation_hook.go passes cpuArchitecture as "", and there are no tests calling GetActualCreateClusterPlatformParams directly.
  • Add table-driven tests covering, for both s390x and ppc64le: external+UMN=true allowed; UMN=false rejected; non-none/non-external rejected.
🤖 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 `@internal/provider/platform.go` around lines 313 - 317, Add table-driven unit
tests that directly call GetActualCreateClusterPlatformParams to exercise the
cpuArchitecture == "s390x" and "ppc64le" branches: for each arch, include cases
where (1) platform is external and userManagedNetworking (UMN) is true — expect
success, (2) UMN is false with external platform — expect rejection/error, and
(3) platform is a non-none/non-external type — expect rejection/error. Use the
same platform helper constructors used in production (e.g.,
createPlatformFromType and common.IsPlatformExternal behavior) and assert
returned platform, boolean flag, and error matches expectations; reference the
function name GetActualCreateClusterPlatformParams, the cpuArchitecture
parameter, and models.PlatformTypeNone in your tests so the coverage
specifically targets the rejected/accepted logic for s390x/ppc64le.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.30%. Comparing base (3b239e5) to head (31f1486).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
internal/provider/platform.go 0.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10424      +/-   ##
==========================================
- Coverage   44.31%   44.30%   -0.01%     
==========================================
  Files         418      418              
  Lines       72844    72846       +2     
==========================================
- Hits        32280    32277       -3     
- Misses      37639    37643       +4     
- Partials     2925     2926       +1     
Files with missing lines Coverage Δ
internal/provider/platform.go 0.00% <0.00%> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Jun 2, 2026

@Neeraj8418: The following test 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 31f1486 link false /test e2e-agent-compact-ipv4-iso-no-registry

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

size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant