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.

Details

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

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

Details

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 19.91701% with 193 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.19%. Comparing base (78f50cd) to head (f248f65).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
contrib/pkg/createcluster/create.go 0.00% 48 Missing ⚠️
...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 ⚠️
.../clusterdeployment/clusterdeployment_controller.go 0.00% 18 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 53.33% 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.40%   50.19%   -0.21%     
==========================================
  Files         279      280       +1     
  Lines       34194    34282      +88     
==========================================
- Hits        17236    17209      -27     
- Misses      15597    15706     +109     
- Partials     1361     1367       +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 45.49% <0.00%> (-0.36%) ⬇️
.../v1/clusterdeployment_validating_admission_hook.go 84.64% <53.33%> (-0.10%) ⬇️
contrib/pkg/deprovision/vsphere.go 0.00% <0.00%> (ø)
pkg/installmanager/installmanager.go 35.85% <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.

Details

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

@dlom
Copy link
Contributor Author

dlom commented Jan 15, 2026

/override ci/prow/security

to be fixed in another PR

@dlom
Copy link
Contributor Author

dlom commented Jan 15, 2026

@2uasimojo this is ready for review (again)

/assign @2uasimojo

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 15, 2026

@dlom: Overrode contexts on behalf of dlom: ci/prow/security

Details

In response to this:

/override ci/prow/security

to be fixed in another PR

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.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 15, 2026

@dlom: 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.

@dlom
Copy link
Contributor Author

dlom commented Jan 15, 2026

@jianping-shu please re-verify this PR, it is ready again

@jianping-shu
Copy link
Contributor

Super! I'm on it.

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