Repository navigation
fix(nodepodprobe): safely initialize Labels map when patching pod probe status - #2530
vishalmore90 wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
a2a3f25 to
052e69d
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2530 +/- ##
==========================================
- Coverage 50.31% 50.26% -0.06%
==========================================
Files 325 325
Lines 28499 28501 +2
==========================================
- Hits 14340 14325 -15
- Misses 12472 12486 +14
- Partials 1687 1690 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
052e69d to
4c0c59b
Compare
…be status Signed-off-by: vishal <httpsvishal07@gmail.com>
4c0c59b to
8639c84
Compare
Ⅰ. Describe what this PR does
This PR fixes a bug in the
NodePodProbecontroller where it panics with a nil pointer dereference when aPodProbeMarkerhas a policy that adds labels to a pod, and the target pod has no existing labels (pod.Labels == nil).The controller safely guarded against nil
Annotations, but did not have the same check forLabels. This PR adds the same initialization check forLabelsto prevent the panic.Ⅱ. Does this pull request fix one issue?
fixes #2527
Ⅲ. Describe how to verify it
To reproduce the issue and verify the fix:
PodProbeMarkertargeting this pod (usingoperator: DoesNotExistfor a dummy label) with aMarkerPolicythat adds a label on success.kruise-managercontroller logs. Without this fix, the controller encounters a panic crash-loop. With this fix, the controller applies the labels without issue.Ⅳ. Special notes for reviews
NONE