Skip to content

Conversation

@dlom
Copy link
Contributor

@dlom dlom commented Aug 11, 2025

xref: HIVE-2391

This PR is a re-do of #2541

See also: openshift/installer#10025

@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 11, 2025

@dlom: This pull request references HIVE-2391 which is a valid jira issue.

In response to this:

xref: HIVE-2391

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-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 11, 2025
@openshift-ci openshift-ci bot requested review from 2uasimojo and jstuever August 11, 2025 19:10
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 11, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dlom

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

The pull request process is described here

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 11, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 11, 2025

@dlom: This pull request references HIVE-2391 which is a valid jira issue.

In response to this:

xref: HIVE-2391

This PR is a re-do of #2541

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.

@dlom
Copy link
Contributor Author

dlom commented Aug 11, 2025

xref: HIVE-2396

@codecov
Copy link

codecov bot commented Aug 11, 2025

Codecov Report

❌ Patch coverage is 22.22222% with 154 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.32%. Comparing base (b0ef85f) to head (1714e7c).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
...om/openshift/hive/apis/hive/v1/vsphere/platform.go 0.00% 47 Missing ⚠️
pkg/controller/machinepool/vsphereactuator.go 52.94% 18 Missing and 6 partials ⚠️
contrib/pkg/createcluster/create.go 0.00% 18 Missing ⚠️
.../clusterdeployment/clusterdeployment_controller.go 0.00% 9 Missing and 1 partial ⚠️
...g/controller/clusterpool/clusterpool_controller.go 0.00% 8 Missing and 1 partial ⚠️
pkg/controller/utils/credentials.go 0.00% 9 Missing ⚠️
contrib/pkg/deprovision/vsphere.go 0.00% 8 Missing ⚠️
pkg/installmanager/installmanager.go 0.00% 8 Missing ⚠️
.../v1/clusterdeployment_validating_admission_hook.go 36.36% 5 Missing and 2 partials ⚠️
pkg/install/generate.go 0.00% 6 Missing ⚠️
... and 2 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2731      +/-   ##
==========================================
- Coverage   50.45%   50.32%   -0.14%     
==========================================
  Files         284      285       +1     
  Lines       33968    34007      +39     
==========================================
- Hits        17140    17113      -27     
- Misses      15489    15549      +60     
- Partials     1339     1345       +6     
Files with missing lines Coverage Δ
pkg/clusterresource/vsphere.go 88.05% <100.00%> (-2.07%) ⬇️
...hift/hive/apis/hive/v1/clusterdeprovision_types.go 0.00% <ø> (ø)
...oller/clusterdeployment/installconfigvalidation.go 91.66% <40.00%> (-8.34%) ⬇️
...s/hive/v1/clusterpool_validating_admission_hook.go 78.08% <28.57%> (-2.77%) ⬇️
pkg/install/generate.go 46.85% <0.00%> (-0.40%) ⬇️
.../v1/clusterdeployment_validating_admission_hook.go 86.92% <36.36%> (-0.11%) ⬇️
contrib/pkg/deprovision/vsphere.go 0.00% <0.00%> (ø)
pkg/installmanager/installmanager.go 35.53% <0.00%> (-0.14%) ⬇️
...g/controller/clusterpool/clusterpool_controller.go 58.83% <0.00%> (-0.22%) ⬇️
pkg/controller/utils/credentials.go 0.00% <0.00%> (ø)
... and 4 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 8, 2025
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 9, 2025
@dlom dlom force-pushed the HIVE-2391 branch 2 times, most recently from 556f051 to afcf08f Compare September 9, 2025 18:02
@dlom
Copy link
Contributor Author

dlom commented Sep 10, 2025

/retest

@red-hat-konflux

This comment was marked as resolved.

@jianping-shu
Copy link
Contributor

@dlom I tried the new commit, install vsphere cd with old format i.e. without platform.vsphere.vSphere still failed due to the same error. Pls. check the comments and hive controlller log attached on https://issues.redhat.com/browse/HIVE-2917.

@newtonheath
Copy link

@dlom can you pick up this again now private image work is in review - need to get this wrapped up

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 16, 2025
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 20, 2025
@dlom dlom force-pushed the HIVE-2391 branch 2 times, most recently from 3b426a3 to 981416a Compare September 25, 2025 05:53
return cloudBuilder, nil
case platform.VSphere != nil:
if platform.VSphere.VSphere == nil {
return nil, errors.New("VSphere CD with deprecated fields has not been updated by CD controller yet, requeueing...")
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. It should be CP/CP controller instead of CD/CD controller
  2. I didn't see the code logic of converting platform.vsphere.attributes to platform.vsphere.vSphere in clusterpool_controller.go like in clusterpool_deployment.go

Copy link
Contributor

@jianping-shu jianping-shu Oct 17, 2025

Choose a reason for hiding this comment

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

Since ClusterPool support for vSphere is NOT supported officially yet(HIVE-2801 not closed and hive doc not updated). One choice is if we can make the judgement/statement that the ClusterPool only support the new format of platform.vsphere.vSphere, this part of code change can be avoided. In that case we need at least make the error in condition/log appropriate and clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think ClusterPool support will have to be bundled into this PR, to prevent a mismatch in functionality between our CD/CP controllers. I'm going to try to add a similar approach for the CP that I used on the CD

contextLogger.Data["oldObject.Name"] = oldObject.Name

// HIVE-2391
if oldObject.Spec.Platform.VSphere != nil && cd.Spec.Platform.VSphere != nil {
Copy link
Member

@2uasimojo 2uasimojo Oct 21, 2025

Choose a reason for hiding this comment

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

This allows/enforces a model where you can transition from old => old+new. I think it would be better if we instead enforced old => new -- i.e. you're forced to scrub the deprecated fields when upconverting. I realize this is going to entail more code because we have to look at each field individually and make sure it's "" (empty string). But IMHO the end result is a lot cleaner.

BTW, I did notice your comment about performance. We're really not concerned about adding more local comparison logic -- the resource consumption, wallclock time, etc is negligible against the overall operation: most of the burden comes from shoving objects over the network.

if oldObject.Spec.Platform.VSphere.VSphere == nil && cd.Spec.Platform.VSphere.VSphere != nil {
contextLogger.Debug("Passed validation: HIVE-2391")
return &admissionv1beta1.AdmissionResponse{
Allowed: true,
Copy link
Member

@2uasimojo 2uasimojo Oct 21, 2025

Choose a reason for hiding this comment

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

As written I think this short circuit would allow you to stealth-edit the other otherwise-immutable fields as part of upconverting. That is undesirable :)

Please add UT to confirm that this ⬆️ can't happen.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 22, 2025
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 22, 2025
go.mod Outdated

replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.9.6

replace github.com/openshift/installer => github.com/dlom/installer v0.0.0-20251022025850-76157f125d29
Copy link
Contributor Author

@dlom dlom Oct 22, 2025

Choose a reason for hiding this comment

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

@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 23, 2025

@dlom: This pull request references HIVE-2391 which is a valid jira issue.

In response to this:

xref: HIVE-2391

This PR is a re-do of #2541

See also: openshift/installer#10025

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.

@dlom
Copy link
Contributor Author

dlom commented Oct 23, 2025

/retest

1 similar comment
@jianping-shu
Copy link
Contributor

/retest

@jianping-shu
Copy link
Contributor

jobs still failed. @dlom Pls. ping me when it is ready for testing, thanks

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 24, 2025

@dlom: all tests passed!

Full PR test history. Your PR dashboard.

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

approved Indicates a PR has been approved by an approver from all required OWNERS files. 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.

6 participants