Skip to content

HIVE-2946: Remove empty vSphere dataDisks from install-config#2904

Open
chdeshpa-hue wants to merge 2 commits intoopenshift:masterfrom
chdeshpa-hue:HIVE-2946-vsphere-datadisks-warning
Open

HIVE-2946: Remove empty vSphere dataDisks from install-config#2904
chdeshpa-hue wants to merge 2 commits intoopenshift:masterfrom
chdeshpa-hue:HIVE-2946-vsphere-datadisks-warning

Conversation

@chdeshpa-hue
Copy link
Copy Markdown

@chdeshpa-hue chdeshpa-hue commented May 8, 2026

Summary

  • remove empty vSphere dataDisks keys from install-config after install-manager mutates secrets, avoiding unknown-field warnings on older payloads
  • keep explicitly configured dataDisks intact so newer payload behavior is preserved
  • add focused unit tests for both removal and preservation scenarios

Test plan

  • go test ./pkg/installmanager -run 'Test_removeUnsupportedVSphereDataDisks|Test_pasteInPullSecret'
  • Run broader Hive CI jobs
  • Confirm warning is absent in ACM vSphere 4.18 flow

Made with Cursor

Strip empty vSphere dataDisks fields after install-config secret mutation to avoid
unknown-field warnings from older installer payloads.

Add focused unit coverage to ensure empty dataDisks are removed while explicitly
configured dataDisks are preserved.

Assisted-by: Codex 5.3
Co-authored-by: Cursor <cursoragent@cursor.com>
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 8, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented May 8, 2026

@chdeshpa-hue: This pull request references HIVE-2946 which is a valid jira issue.

Details

In response to this:

Summary

  • remove empty vSphere dataDisks keys from install-config after install-manager mutates secrets, avoiding unknown-field warnings on older payloads
  • keep explicitly configured dataDisks intact so newer payload behavior is preserved
  • add focused unit tests for both removal and preservation scenarios

Test plan

  • go test ./pkg/installmanager -run 'Test_removeUnsupportedVSphereDataDisks|Test_pasteInPullSecret'
  • Run broader Hive CI jobs
  • Confirm warning is absent in ACM vSphere 4.18 flow

Made with Cursor

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 jstuever and suhanime May 8, 2026 10:09
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 8, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 8, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 8, 2026

Hi @chdeshpa-hue. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Warning

Rate limit exceeded

@chdeshpa-hue has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 24 minutes and 52 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 8658c929-48c4-469b-a091-1e53ccf84fae

📥 Commits

Reviewing files that changed from the base of the PR and between 3c5cf93 and c1eb2e8.

📒 Files selected for processing (1)
  • pkg/installmanager/installmanager.go
📝 Walkthrough

Walkthrough

The pasteInInstallConfigSecrets function is modified to post-process marshaled YAML by removing empty vSphere dataDisks fields. A new removeUnsupportedVSphereDataDisks helper builds JSON-patch operations to conditionally remove dataDisks from control plane, arbiter, and compute configurations when they are empty.

Changes

vSphere DataDisks Cleanup

Layer / File(s) Summary
Core Helper
pkg/installmanager/installmanager.go (lines 1997–2040)
New removeUnsupportedVSphereDataDisks helper builds JSON-patch operations to remove empty dataDisks from control plane, arbiter, and compute vSphere platform configurations.
Integration & Wiring
pkg/installmanager/installmanager.go (lines 1980–1995), pkg/installmanager/installmanager_test.go (line 31)
pasteInInstallConfigSecrets now marshals InstallConfig and calls the helper to post-process the YAML. New import of github.com/openshift/installer/pkg/types/vsphere added for test validation.
Tests
pkg/installmanager/installmanager_test.go (lines 822–883)
New Test_removeUnsupportedVSphereDataDisks validates removal of empty dataDisks from control plane and compute pools, and preservation when explicitly configured.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Empty disks upon the plane,
We sweep away the unused strain,
JSON patches dance so right,
vSphere config shines so bright! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: removing empty vSphere dataDisks from install-config YAML after secret injection.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

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 `@pkg/installmanager/installmanager.go`:
- Around line 2035-2038: The call to yamlutils.ApplyPatches in the
installmanager should not abort the install on failure; instead catch the error
from yamlutils.ApplyPatches(icData, patches), log or wrap it as a non-fatal
warning, and fall back to using the original icData bytes (or previously
serialized install-config bytes) rather than returning an error. Update the
block around modifiedBytes, err to handle err by preserving icData (or original
bytes) in modifiedBytes and continuing, referencing yamlutils.ApplyPatches,
modifiedBytes, icData and patches so the patch removal failure becomes a
warning/fallback rather than a hard return.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e766d14e-94e1-49e5-af8b-742b43b1f855

📥 Commits

Reviewing files that changed from the base of the PR and between a6c32a8 and 3c5cf93.

📒 Files selected for processing (2)
  • pkg/installmanager/installmanager.go
  • pkg/installmanager/installmanager_test.go

Comment thread pkg/installmanager/installmanager.go
Fall back to original install-config data if YAML patching fails
instead of aborting the install, which would be worse than the
original unknown-field warning.

Addresses CodeRabbit review feedback on PR openshift#2904.

Assisted-by: Codex 5.3
Co-authored-by: Cursor <cursoragent@cursor.com>
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. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants