Skip to content

Conversation

jstuever
Copy link
Contributor

@jstuever jstuever commented Oct 9, 2025

privatelink: pass privatelink enabled status into actuators

Previously, the aws hub actuator was using its own platform logic to
determine if privatelink was enabled on the cluster deployment. This
caused a nil pointer exception when deleting non-aws clusters with
preserve on delete because the spec.platform.aws value was nil. More
importantly, the logic was flawed because it should instead be based on
the cluster deployment's platform.

This change passes the privatelink enabled status from the controller to
each of the actuators on creation. The controller was already using the
cluster deploymnet's platform to determine if privatelink is enabled.
Passing this value into the actuators enables the aws hub actuator to
properly determine if cleanup is required while avoiding the nil pointer
exception altogether.

privatelink: reconcile to exit early when privatelink is not enabled.

Previously, the privatelink controller would create actuators for every
clusterdeployment regardless of if it uses privatelink. This caused
serveral issues in clusers that were not configured for the specified
hub and/or link platforms.

This change causes the reconcile to exit early when the cd does not have
privatelink enabled and has never been configured to use privatelink as
evident by the lack of a finalizer. This keeps the cluster from trying
to create actuators when privatelink is disabled while still enabling
to cleanup in the case where it had previously been enabled.

Previously, the privatelink controller would create actuators for every
clusterdeployment regardless of if it uses privatelink. This caused
serveral issues in clusers that were not configured for the specified
hub and/or link platforms.

This change causes the reconcile to exit early when the cd does not have
privatelink enabled and has never been configured to use privatelink as
evident by the lack of a finalizer. This keeps the cluster from trying
to create actuators when privatelink is disabled while still enabling
to cleanup in the case where it had previously been enabled.
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Oct 9, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 9, 2025

@jstuever: This pull request references HIVE-2954 which is a valid jira issue.

In response to this:

privatelink: pass privatelink enabled status into actuators

Previously, the aws hub actuator was using its own platform logic to
determine if privatelink was enabled on the cluster deployment. This
caused a nil pointer exception when deleting non-aws clusters with
preserve on delete because the spec.platform.aws value was nil. More
importantly, the logic was flawed because it should instead be based on
the cluster deployment's platform.

This change passes the privatelink enabled status from the controller to
each of the actuators on creation. The controller was already using the
cluster deploymnet's platform to determine if privatelink is enabled.
Passing this value into the actuators enables the aws hub actuator to
properly determine if cleanup is required while avoiding the nil pointer
exception altogether.

privatelink: reconcile to exit early when privatelink is not enabled.

Previously, the privatelink controller would create actuators for every
clusterdeployment regardless of if it uses privatelink. This caused
serveral issues in clusers that were not configured for the specified
hub and/or link platforms.

This change causes the reconcile to exit early when the cd does not have
privatelink enabled and has never been configured to use privatelink as
evident by the lack of a finalizer. This keeps the cluster from trying
to create actuators when privatelink is disabled while still enabling
to cleanup in the case where it had previously been enabled.

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 2uasimojo and suhanime October 9, 2025 18:01
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 9, 2025
Copy link

codecov bot commented Oct 9, 2025

Codecov Report

❌ Patch coverage is 29.41176% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.33%. Comparing base (c279504) to head (d1e41de).
⚠️ Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
...g/controller/privatelink/privatelink_controller.go 0.00% 11 Missing ⚠️
...rivatelink/actuator/gcpactuator/gcplinkactuator.go 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2762      +/-   ##
==========================================
- Coverage   50.33%   50.33%   -0.01%     
==========================================
  Files         284      284              
  Lines       33952    33968      +16     
==========================================
+ Hits        17090    17098       +8     
- Misses      15517    15523       +6     
- Partials     1345     1347       +2     
Files with missing lines Coverage Δ
...privatelink/actuator/awsactuator/awshubactuator.go 88.85% <100.00%> (+0.02%) ⬆️
...rivatelink/actuator/gcpactuator/gcplinkactuator.go 85.20% <50.00%> (-0.22%) ⬇️
...g/controller/privatelink/privatelink_controller.go 10.09% <0.00%> (-0.29%) ⬇️

... and 2 files with indirect coverage changes

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

Copy link
Member

@2uasimojo 2uasimojo left a comment

Choose a reason for hiding this comment

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

This lgtm, but I would at least like to see some extra comments as noted inline... or we could do some refactoring 😇

@jstuever jstuever force-pushed the HIVE-2954 branch 2 times, most recently from 8950f59 to 46b92ca Compare October 15, 2025 20:33
@jstuever jstuever requested a review from 2uasimojo October 15, 2025 20:35
// necessary cloud clients, such as a hive config without privatelink configured.
// We can't check this with cleanupRequired() yet because that method requires the actuators to
// already exist. We also want to ensure we remove the finalizer, which happens later in the
// process. We can use the finazer itself to determine if we can safely return here. If there
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// process. We can use the finazer itself to determine if we can safely return here. If there
// process. We can use the finalizer itself to determine if we can safely return here. If there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@2uasimojo 2uasimojo left a comment

Choose a reason for hiding this comment

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

lgtm -- wanna fix the typo?

Previously, the aws hub actuator was using its own platform logic to
determine if privatelink was enabled on the cluster deployment. This
caused a nil pointer exception when deleting non-aws clusters with
preserve on delete because the spec.platform.aws value was nil. More
importantly, the logic was flawed because it should instead be based on
the cluster deployment's platform.

This change passes the privatelink enabled status from the controller to
each of the actuators on creation. The controller was already using the
cluster deploymnet's platform to determine if privatelink is enabled.
Passing this value into the actuators enables the aws hub actuator to
properly determine if cleanup is required while avoiding the nil pointer
exception altogether.
@2uasimojo
Copy link
Member

/test e2e-gcp

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 17, 2025
Copy link
Contributor

openshift-ci bot commented Oct 17, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 2uasimojo, jstuever

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

Copy link
Contributor

openshift-ci bot commented Oct 18, 2025

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

@openshift-merge-bot openshift-merge-bot bot merged commit f84d11f into openshift:master Oct 18, 2025
21 checks passed
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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants