-
Notifications
You must be signed in to change notification settings - Fork 254
HIVE-2954: resolve nil pointer exception when deleting a privatelink cluster with preserve on delete. #2762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
@jstuever: This pull request references HIVE-2954 which is a valid jira issue. In response to this:
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. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ 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
🚀 New features to boost your workflow:
|
There was a problem hiding this 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 😇
8950f59
to
46b92ca
Compare
// 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this 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.
/test e2e-gcp /lgtm |
[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 |
@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. |
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.