Skip to content

Commit

Permalink
Fix Ready condition nil pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
fra98 committed Sep 21, 2023
1 parent 760021d commit 8d1f117
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/virtualKubelet/reflection/workload/podns.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,14 @@ func (npr *NamespacedPodReflector) HandleStatus(ctx context.Context, local, remo
// in sync the endpointslice Ready condition with the associated pod Ready condition).
if podstatusctrl.HasRemoteUnavailableLabel(local) {
cond := pod.GetPodCondition(&po.Status, corev1.PodReady)
cond.Status = corev1.ConditionFalse
if cond == nil {
po.Status.Conditions = append(po.Status.Conditions, corev1.PodCondition{
Type: corev1.PodReady,
Status: corev1.ConditionFalse,
})
} else {
cond.Status = corev1.ConditionFalse
}
}

// Do not attempt to perform an update if not necessary.
Expand Down

0 comments on commit 8d1f117

Please sign in to comment.