-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[release-1.4] š controlplane: prevent nil pointer exception in kcp controller when inā¦ #8991
[release-1.4] š controlplane: prevent nil pointer exception in kcp controller when inā¦ #8991
Conversation
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.
Generally lgtm, would it be possible to add a test case that replicates the nil exception?
ā¦framachine does not exist for machine
4055700
to
4253ac6
Compare
Adjusted the existing test to also catch this case. |
Also created a PR for main which adds the same test: #8992 |
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.
/approve
/lgtm
LGTM label has been added. Git tree hash: 1a31b4cd1412baf7c56c9ca88d9968098e91cb6f
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vincepri 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 |
/area provider/control-plane-kubeadm |
ā¦framachine does not exist for machine
What this PR does / why we need it:
This is a manual cherry-pick of changes which are already on main via https://github.com/kubernetes-sigs/cluster-api/pull/8940/files#diff-47cf5969a7a97b70232c5d97b882424745bd1ed511b29aa56f55194688ab833cR631-R634
It fixes a nil pointer by checking if the infraObject is nil.
This could maybe happen e.g. when the InfraMachine has a
DeletionTimestamp
.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #8989
The bug was introduced via the label propagation changes for v1.4, so previous versions should not be affected.
Also this is already fixed on main. This change is a manual cherry-pick of the related changes.